Faragiri
English

Choose a language 2

Learn Layout Visual design

A Zurich physiotherapy diary that was correct at 1440, 1024 and 390, and collapsed to eighteen characters at 860.

7Sections
5Min read
4Depth

Recommended Before This

0 / 1

A layout is designed at three widths and used at every width in between. That single sentence accounts for most of what goes wrong on a screen that resizes, and the repair is not more breakpoints, it is fewer.

Nadja is rebuilding the diary for a physiotherapy clinic in Zurich. It runs on a reception desktop, on a tablet in a treatment room and on a phone in a physiotherapist's pocket, and the same screen has to hold a day list, a patient panel and one action.

Three regions, and one of them is optional

Three regions: a chrome that does not scroll, a flexible list, and a detail panel. The chrome is 64 px, carries the date and the one action, and stays put while everything under it moves.

One diary, three regions

Three layout regions, one scroll container, and one threshold

A fixed 64 px chrome, a single scrolling list, and a 380 px detail panel define the whole screen structure.

clinic/diary/today
  1. 0164 px, holds date and one action
  2. 02single scroll container
  3. 03380 px wide, full screen below 900
  1. 01Fixed chromestays pinned while everything below moves
  2. 02Flexible day listavoids nested scroll traps where wheel and touch move the wrong panel
  3. 03Detail panelthe lone breakpoint, set where two regions stop fitting beside each other

The 900 breakpoint reflects available room for a 380 px panel beside a list, not a specific hardware screen.

Modular Type Scale & CSS Flex/Grid Motion Lab

Test harmonic typography ratios and live Flexbox/Grid layouts with 1-click CSS export.

The detail panel is 380 px and becomes a full screen below 900. That is the only breakpoint on the screen, and it exists because a 380 px panel beside a list stops being usable at a total width where neither has room, which is a real threshold rather than a device size.

One scroll container per screen, because two is the commonest dense app fault. A list that scrolls inside a page that also scrolls produces a moment where the wheel does the wrong thing, and on a touch screen it produces a panel that will not move because the finger started in the wrong region.

Intrinsic first, breakpoints second

Reach for min, clamp and auto-fit before reaching for a breakpoint. A grid whose columns are declared as auto-fit with a minimum width reflows continuously and correctly at every width, including the ones nobody tested.

Sizing order

Climb from fluid CSS up to a single viewport breakpoint

Intrinsic rules handle every intermediate width automatically, leaving breakpoints only for real structural thresholds.

  1. 03Single viewport breakpointused only where the 380 px panel can no longer sit beside the listexception
  2. 02Container-sized appointment cardstacks below 320 px of its own box in lists, panels, or printcomponent
  3. 01Fluid grid with min, clamp, and auto-fitreflows continuously at untested widths such as 860 pxbase

One container-aware card removes the need to maintain three separate card variants.

Then add a breakpoint only where the intrinsic answer is wrong. On this diary there is exactly one such place, which is the panel above. Every other adjustment is the layout responding to how much room it has, and the difference shows at 860 px, where a layout built from breakpoints is in whichever bucket somebody assigned and a layout built intrinsically is simply narrower.

Size components with the container, not the viewport. The appointment card stacks below 320 px of its own width, whatever the screen is, which means the same card works in the wide list, in the narrow panel and in a printed day sheet without three variants of it existing.

Two constants

The notes column stops at 66ch, even inside an application. A clinical note on a 27 inch monitor is otherwise 180 characters wide, and the fact that this is an application rather than an article does not change how far the eye can travel back.

Two constants

Two anchors that stay invariant across every screen size

Line length stays capped for reading speed and the main action never relocates across breakpoints.

Unchanging usability anchors
  • 66ch clinical note widthprevents lines from stretching to 180 characters on a 27 inch display
  • Fixed primary action positionStart appointment stays bottom right for forty taps a day without hunting

Same clinic workflow on phone, tablet, and desktop

Moving a high-frequency button at a breakpoint breaks muscle memory for experienced clinicians.

The primary action does not move between widths. Start appointment is at the bottom right of the chrome at every size, because a physiotherapist presses it forty times a day and the hand goes there before the eye does. A control that relocates at a breakpoint costs an expert user something a new user never notices.

The inset nobody reserves

Reserve the phone's bottom inset, or the last row sits under the home indicator. It is one CSS environment value, it is zero on every device without an inset, and leaving it out means the last appointment of the day is permanently half covered on exactly the device the physiotherapists carry.

Safe area

One environment inset protects the last row on phones

Leaving out the bottom safe-area inset traps the final appointment of the day behind the home indicator.

Does the current device render a bottom home indicator?
  • Phone with home bar
    Reserve bottom CSS insetkeeps the final diary row visible above the gesture bar
  • Tablet or desktop
    Inset resolves to zeroadds no extra padding where no hardware bar exists

One CSS environment value protects the carried phone without affecting larger screens.

What to open

CSS container queries are the change worth building around, part of the language and in every current browser since 2023, and they replaced a media query that asks about the window when the question was about the card. A component that knows its own width is a component that can be moved anywhere without a variant.

What to open

Build on container queries and test by dragging continuously

Checking only fixed device presets misses the jumps and collapses that show up during a ten-second window drag.

Continuous responsiveness checks

  1. YesSize components with container queriesin every current browser since 2023; cards query their own widthYes
  2. YesResize the browser slowly from wide to narrowspend ten seconds watching for overlaps, jumps, or crushed columnsYes
  3. NoSign off after checking three preset widthspasses only the widths the artboards were drawn atNo

A one-minute drag test reveals intermediate collapses that static device screenshots never hit.

Resizing the real browser slowly is the test, free, and it replaces checking three fixed widths, which is where every layout is correct because those are the widths it was drawn at. Drag the edge from wide to narrow over about ten seconds and watch for the moment something jumps, overlaps or collapses. It takes a minute per screen.

Where it stalls: the widths that were drawn

Design files have artboards, artboards have sizes, and the sizes are chosen at the start of the project from a list of common devices. Everything after that is drawn, reviewed and approved at those three or four widths.

Where it stalls

Approving fixed artboard widths leaves real windows untested

Builds match the three or four widths chosen on day one, failing when OS sidebars or landscape phones alter available space.

Adding more artboards bloats design files without closing the gaps between them.

The build then matches them, because matching them is what the review checks. And the product ships into a world where a browser window is any width at all, a tablet has a sidebar that takes 260 px, and a phone in landscape is a size nobody put on the list.

Nothing in the process is wrong except the sampling. Adding more artboards does not fix it and makes the file heavier; building intrinsically does, because a layout that responds to its content has no untested widths.

What it looks like when it goes wrong

The clinic's previous diary was correct at 1440, at 1024 and at 390, which had been checked carefully every release. At 860 px, which is what a treatment room tablet gives you in portrait with the operating system's sidebar open, the layout was still in its wide bucket: the list and the 380 px panel both claimed their widths, the notes column collapsed to about eighteen characters, and clinical notes wrapped every three words. Two physiotherapists had been rotating the tablet to landscape for a year, and it had been reported as the tablet being awkward.

When it goes wrong

Where 860 px sat inside the untested gap below 900 px

Tested at 1440, 1024, and 390, the old diary kept its wide layout on an 860 px portrait tablet and crushed notes to eighteen characters.

available viewport width from narrow phone to desktop

390 (phone)1440 (desktop)
  1. 390 (tested)narrow layout passed release checks
  2. 860 px (portrait + sidebar)stayed in wide bucket with 380 px panel, wrapping notes every three words
  3. 900 px (panel threshold)the real point where list and 380 px panel stop fitting side by side
  4. 1024 (tested)wide layout fit cleanly during release checks
  5. 1440 (tested)clinical notes stayed readable near 66ch

Physiotherapists rotated the tablet to landscape for a year, blaming the hardware for a missing threshold.

Every gap and padding in these three regions comes off one scale, and applying it is a scale, applied consistently. The single breakpoint at 900 px is a decision with evidence behind it, and how to choose one is where the layout changes, and why there. The 66ch limit is the same measure argument that runs through print, which is how many, and how wide a line should be. What the surface underneath all of this is made of is one level up, in making an interface look considered.

Alongside this

Above this