# Adapt across sizes {#c5}

> Chapter 5 of the App Design Guide 3.0.0. Index: https://www.designguide.dev/llms.txt

A product must work on a phone, a tablet, a desktop browser, and a desktop app. This chapter sets the size classes and how each part changes between them.

## Read the window {#s5-1}

The guide uses four width classes. The window sets the class, not the device. "Wide screen" means Expanded and Large, unless a rule says otherwise. Input is not size: a rule that depends on the pointer or keyboard says so in its own chip. A rule here carries the Adapts tag only when it has a separate Wide screen line.

| Class | Width in px | Layout |
| --- | --- | --- |
| Compact | Under 600 | Phone. A bottom bar and one pane. |
| Medium | 600 to 839 | Small tablet. A rail and one pane. |
| Expanded | 840 to 1199 | Tablet or small window. A rail, a list, and a detail pane. |
| Large | 1200 and up | Desktop. A sidebar, a list, and a detail pane. |

The table shows how ten common patterns change from class to class. Each rule below gives the reason and a picture.

| Pattern | Compact | Medium | Expanded and Large |
| --- | --- | --- | --- |
| Navigation | Bottom bar | Rail | Expanded: rail, sidebar on request. Large: sidebar |
| List and detail | One pane, Back returns | One pane, Back returns | Expanded: list beside detail, with a rail. Large: sidebar, list, and detail |
| Forms | One column | One column, capped width | One column, capped width |
| Primary action | Pinned at the bottom | Pinned, or in the header | In the toolbar or the dialog footer |
| Overlays | Bottom sheet | Centered sheet or popover | Popover, side panel, or dialog |
| Search and filters | Search icon, filters in a sheet | Search field in the top bar | Search always in view, filters beside the results |
| Tables | Card per row, or a table in a scroll box | Table with fewer columns | Full table with a pinned header |
| Charts | One series, press for values | Two series, inline legend | Chart beside its table |
| Toolbars | 4 actions, the rest in a menu | More actions in view | All common actions in view, labels by icons |
| Settings | List of categories, push into one | List, then a page | Categories beside the rows |

These widths are Default values, as a start. Change them after a test with real content. Rules 5.10, 5.12, 5.14, and 5.18 use them.

| Part | Width in px, as a start | Rule |
| --- | --- | --- |
| Rail | 72 | [5.10](https://www.designguide.dev/r/move-navigation-from-bar-to-rail-to-sidebar.md) |
| Sidebar | 220 to 280 | [5.12](https://www.designguide.dev/r/add-an-inspector-only-if-each-pane-fits.md) |
| List pane | 280 to 360 | [5.12](https://www.designguide.dev/r/add-an-inspector-only-if-each-pane-fits.md) |
| Detail pane | At least 360 | [5.12](https://www.designguide.dev/r/add-an-inspector-only-if-each-pane-fits.md) |
| Inspector | 280 to 320 | [5.12](https://www.designguide.dev/r/add-an-inspector-only-if-each-pane-fits.md) |
| Form column | 480 to 640 | [5.18](https://www.designguide.dev/r/cap-the-width-of-buttons-fields-and-sheets.md) |
| Dialog | Up to 560 | [5.18](https://www.designguide.dev/r/cap-the-width-of-buttons-fields-and-sheets.md) |
| Button | At most about 320 | [5.18](https://www.designguide.dev/r/cap-the-width-of-buttons-fields-and-sheets.md) |

### 5.1 Decide from the window size, not the device  {#decide-from-the-window-size-not-the-device}

Default

**Rule:** Choose the layout from the width of the window, never from the type of device or the screen orientation.

**Why:** The same app runs in a split view and on a large display. Device type hides the room.  **When not:** Ask about the device only for a hardware feature, such as a camera.

- Read the window width and height, not a device name.
- Pick one class: Compact, Medium, Expanded, or Large.
- Lock the orientation only for a camera or a game ([Rule 5.23](https://www.designguide.dev/r/keep-the-place-when-the-screen-turns.md)).

**Picture:** Do: A tablet in a 540 px split view: width picks one pane. Don't: The same tablet and width. The device type picks two panes.

**See:** [5.23 Keep the place when the screen turns](https://www.designguide.dev/r/keep-the-place-when-the-screen-turns.md)

### 5.2 Treat the size class as live state  {#treat-the-size-class-as-live-state}

Default

**Rule:** Read the size class again whenever the window changes, such as on a resize, a turn, a split view, or a fold.

**Why:** A person can resize, turn, or split the window at any moment. A layout fixed at launch breaks.

- Pick the layout again on every size change.
- Keep the open item through the change (see [Rule 5.7](https://www.designguide.dev/r/keep-state-across-a-layout-change.md)).

**Picture:** Do: After the window narrows to 540 px, the layout shows one pane. Don't: After the window narrows to 540 px, the layout keeps two panes.

**See:** [5.7 Keep state across a layout change](https://www.designguide.dev/r/keep-state-across-a-layout-change.md)

### 5.3 Design for four width classes  {#design-for-four-width-classes}

Default

**Rule:** Design for four width classes: Compact under 600, Medium 600 to 839, Expanded 840 to 1199, and Large 1200 and up.

**Why:** Each class has one shell (a bar, a rail, or a sidebar) and a pane count.  **When not:** A component in a narrow slot follows its own width (see [Rule 5.20](https://www.designguide.dev/r/size-a-component-by-its-slot.md)).

- Write every width in px (or dp, or pt).
- Use the same four names in every file and every talk.
- Test the edges: 599, 600, 839, 840, 1199, and 1200.

**Picture:** Do: Width picks Large: a sidebar, a list, and a detail pane. Don't: The device name picks tablet: a rail and one pane at 1200 px.

**See:** [5.20 Size a component by its slot](https://www.designguide.dev/r/size-a-component-by-its-slot.md)

### 5.4 Widen until it breaks, then add a breakpoint  {#widen-until-it-breaks-then-add-a-breakpoint}

Default

**Rule:** Start with the smallest layout, widen the window until it looks wrong, and add one change at that width.

**Why:** Content decides where a layout fails, not a device list.  **When not:** Do not add a breakpoint for one device model.

- Make 375 px first, check 320 px, then widen.
- Note the first width where text wraps badly or a gap looks empty.
- Add one change there, and check up to the next class.

**Picture:** Do: The list and the detail share the width at 840 px. Don't: The one-pane list stretches across 840 px and leaves a gap.

### 5.5 Work at 320 px with no sideways scroll  {#work-at-320-px-with-no-sideways-scroll}

Hard

**Rule:** Make every layout work at 320 px wide, with no sideways scroll except inside a table or a map.

**Why:** Zooming a window to 400% gives a 320 px layout, as does a narrow split view.

- Stack side-by-side parts, let text wrap, and never cut a word.
- Put a wide table in its own scroll box.
- [Rule 15.25](https://www.designguide.dev/r/reflow-at-320-wide-and-at-400-zoom.md) holds the full reflow and zoom rule.

**Picture:** Do: The buttons stack. Every label shows in full. Don't: Four buttons keep one row. The row is wider than the screen.

**See:** [15.25 Reflow at 320 wide and at 400% zoom](https://www.designguide.dev/r/reflow-at-320-wide-and-at-400-zoom.md)

## Keep one product {#s5-2}

### 5.6 Keep every function at every size  {#keep-every-function-at-every-size}

Hard

**Rule:** Keep every function available at every size, and change only how much shows at once.

**Why:** A person who changes device expects the same app.  **When not:** A function that needs hardware, such as a camera, may use another path where that hardware is missing.

- At Compact, put a minor action in a menu.
- At Expanded and Large, show the same action as a button.
- Never remove a function to make a layout fit.

**Picture:** Size pair (Phone, 375; Window, 1280): Edit goal sits in a menu on the phone and in the toolbar of the window.

### 5.7 Keep state across a layout change  {#keep-state-across-a-layout-change}

Hard

**Rule:** Keep the scroll place, the selection, open panels, and typed text when the layout changes.

**Why:** A resize or a turn must not cost a person their place.

- Hold state above the layout, not inside one layout.
- Pass all data to each part, even data a small layout hides.
- Reopen a flow at the same step with the answers in place.

**Picture:** Size pair (Phone, 375; Window, 1280): The open order and the typed note stay when the window narrows from 1280 to 375.

### 5.8 Use one set of names on every size  {#use-one-set-of-names-on-every-size}

Default

**Rule:** Use the same names, icons, order, and data on every size.

**Why:** A person builds one map of the product. A new name for the same thing breaks it.

- Feed bar, rail, and sidebar from one destination list.
- Show the same fields with the same labels at every size.
- Open on the item that the person used last.

**Picture:** Do: The phone and the window both say Workouts. Don't: The phone says Workouts. The window says Training.

### 5.9 Continue where the person left off  {#continue-where-the-person-left-off}

Default

**Rule:** When a person changes device, restore the same object, scroll place, and draft at the same step.

**Why:** People start on a phone and finish on a larger screen.  **When not:** Start again from a safe step when the draft has expired or holds a private value.

- Save drafts on the server, not only on the device.
- Offer a way to start fresh.
- Name the source device and the age of the draft.

**Picture:** Size pair (Phone, 375; Window, 1280): A booking that begins on the phone opens at step 2 in the window, with its dates.

## Navigation and panes {#s5-3}

### 5.10 Move navigation from bar to rail to sidebar  {#move-navigation-from-bar-to-rail-to-sidebar}

Default

**Rule:** Show the same destinations as a bottom bar at Compact, a rail at Medium and Expanded, and a sidebar at Large.

**Why:** The bottom edge is far away on a large window. A sidebar uses the width that it has.  **When not:** A tool with one main area needs no navigation bar.

- Keep 3 to 5 destinations in bar and rail ([Rule 4.2](https://www.designguide.dev/r/use-3-to-5-labeled-tabs.md)).
- Collapse the sidebar to a rail below 1200; let the person reopen it.
- With over 5 areas, put the least used under More at Compact and Medium.

**Picture:** Size chain (Compact, 375; Medium, 768; Large, 1280): The same four destinations as a tab bar, a rail, and a sidebar. Today stays first.

**See:** [4.2 Use 3 to 5 labeled tabs](https://www.designguide.dev/r/use-3-to-5-labeled-tabs.md)

### 5.11 Show one pane, then list beside detail  {#show-one-pane-then-list-beside-detail}

Default

**Rule:** Show one pane at Compact and Medium, then list beside detail at Expanded, and a sidebar, list, and detail at Large.

**Why:** Two panes in a narrow window wrap and cut text. One pane keeps one task on the screen.  **When not:** A Medium window 640 by 480 px or more may show two panes of 320 px each.

- At Compact, open an item over the list, with Back to return.
- When the window narrows or widens, keep the open item.
- At Expanded, keep the rail; the list takes 280 to 360 px.

**Picture:** Size chain (Compact, 375; Medium, 768; Large, 1280): Compact and Medium show one pane. Large shows a sidebar, the list, and the order.

### 5.12 Add an inspector only if each pane fits  {#add-an-inspector-only-if-each-pane-fits}

Default

**Rule:** At Large, show a sidebar, list, and detail pane, and add an inspector only when every pane keeps its minimum width.

**Why:** A narrow pane cuts its text and hides its controls. Three good panes beat four cramped ones.

- Start with minimums: sidebar 220, list 280, detail 360 px.
- Give an inspector 280 to 320 px, and a rail 72 px.
- Test the layout at 1200 px, the narrowest Large width.

**Picture:** Do: The detail pane has room to show its content. Don't: Four columns leave the detail pane too narrow to read.

### 5.13 Mark the selected row and show a placeholder  {#mark-the-selected-row-and-show-a-placeholder}

Default

**Rule:** Mark the selected row in a list, and show a placeholder in the detail pane when nothing is selected.

**Why:** The mark ties the detail to its row. A blank pane looks like an error.

- Mark the selected row with fill and bold text, never color alone.
- Write the placeholder as an instruction: Select an order ([Rule 8.25](https://www.designguide.dev/r/fill-an-empty-pane-and-an-empty-table.md)).
- Keep the selected row in view when the list scrolls.

**Picture:** Do: The selected row has a fill. Its detail shows beside it. Do: With no selection, the detail pane says what to do. Don't: A blank detail pane looks broken.

**See:** [8.25 Fill an empty pane and an empty table](https://www.designguide.dev/r/fill-an-empty-pane-and-an-empty-table.md)

### 5.14 Let the person resize panes within limits  {#let-the-person-resize-panes-within-limits}

Default · Desktop only

**Rule:** Let a person drag or key a pane divider, with a minimum width, a collapse order, and a remembered size.

**Applies with:** Fine pointer, Keyboard

**Why:** Needs differ by task. A divider with limits lets a person trade list room for detail room.  **When not:** A layout with one pane needs no divider.

- Use the [Rule 5.12](https://www.designguide.dev/r/add-an-inspector-only-if-each-pane-fits.md) minimums; no detail maximum under 480 px.
- Collapse the inspector first, then the list, then the sidebar.
- Show a resize cursor on hover; arrow keys move the focused divider.

**Picture:** Figure: The divider moves with the pointer. Each pane keeps its minimum width.

**See:** [5.12 Add an inspector only if each pane fits](https://www.designguide.dev/r/add-an-inspector-only-if-each-pane-fits.md)

### 5.15 Load and empty each pane on its own  {#load-and-empty-each-pane-on-its-own}

Default

**Rule:** Show a skeleton or an empty state inside each pane, never one loader over the whole window.

**Why:** A large window holds many panes. Each pane needs its own state.

- Keep sidebar and list in view while detail loads ([Rule 8.2](https://www.designguide.dev/r/shape-the-skeleton-like-the-final-content.md)).
- Center an empty state in its own pane, with one next step.
- Keep the layout the same from zero to done (see [Rule 8.22](https://www.designguide.dev/r/keep-one-layout-from-zero-to-done.md)).

**Picture:** Do: The list is ready. Only the detail pane shows a skeleton. Don't: One skeleton hides the whole window until all data arrives.

**See:** [8.2 Shape the skeleton like the final content](https://www.designguide.dev/r/shape-the-skeleton-like-the-final-content.md), [8.22 Keep one layout from zero to done](https://www.designguide.dev/r/keep-one-layout-from-zero-to-done.md)

## Use the space {#s5-4}

### 5.16 Cap line length at 45 to 75 characters  {#cap-line-length-at-45-to-75-characters}

Default

**Rule:** Cap a line of body text at 45 to 75 characters, even in a large window.

**Why:** Short lines break reading rhythm. Long lines make the eye lose its place at the next line.  **When not:** A table, a code block, and a chart may use the full width.

- Cap the width by text size, such as 65 characters.
- The cap starts to matter at Medium (600 and up).
- [Rule 3.25](https://www.designguide.dev/r/cap-content-width-and-line-length.md) caps the content column. [Rule 5.18](https://www.designguide.dev/r/cap-the-width-of-buttons-fields-and-sheets.md) caps controls.

**Picture:** Do: The text column keeps lines near 45 characters and sits centered. Don't: The same text spans the window. A line runs past 75 characters.

**See:** [3.25 Cap content width and line length](https://www.designguide.dev/r/cap-content-width-and-line-length.md), [5.18 Cap the width of buttons, fields, and sheets](https://www.designguide.dev/r/cap-the-width-of-buttons-fields-and-sheets.md)

### 5.17 Do not stretch the layout  {#do-not-stretch-the-layout}

Default

**Rule:** Reposition the parts, cap their width, or add a pane as the window grows, and never stretch the phone layout.

**Why:** A stretched layout makes long rows, giant controls, and large gaps.

- Move content into a grid, a table, or a second pane.
- Keep the shell the same and cap the width of the content.
- [Rule 5.16](https://www.designguide.dev/r/cap-line-length-at-45-to-75-characters.md) caps line length. [Rule 5.18](https://www.designguide.dev/r/cap-the-width-of-buttons-fields-and-sheets.md) caps control width.

**Picture:** Do: The same workouts move into tiles and a table in the window. Don't: The same workouts stay as phone rows stretched across the window.

**See:** [5.16 Cap line length at 45 to 75 characters](https://www.designguide.dev/r/cap-line-length-at-45-to-75-characters.md), [5.18 Cap the width of buttons, fields, and sheets](https://www.designguide.dev/r/cap-the-width-of-buttons-fields-and-sheets.md)

### 5.18 Cap the width of buttons, fields, and sheets  {#cap-the-width-of-buttons-fields-and-sheets}

Default

**Rule:** Give a button, a field, and a sheet a maximum width on a wide window.

**Why:** A button 1200 px long is hard to aim at and to scan.

- Open a sheet as a centered panel, not edge to edge.
- As a start, cap a form column at 480 to 640 px.
- Start with a 560 px dialog and a button of about 320 px at most.

**Picture:** Do: The fields and the button keep their own width. Don't: The fields and the button span the whole window.

### 5.19 Spend extra width on more detail  {#spend-extra-width-on-more-detail}

Default · Adapts

**Rule:** Use extra width for more panes, columns, and detail per row, before bigger controls or wider margins.

**Wide screen:** On a wide screen, show owner and size beside each name, and hide neither. (Triggers: Width 840+, Dense data)

**Why:** A large window shows more at once and saves steps. Empty margins waste that.  **When not:** A reading page keeps its capped text width (see [Rule 5.16](https://www.designguide.dev/r/cap-line-length-at-45-to-75-characters.md)).

- Order: panes, columns, detail per row, then margins.
- At Compact, show the title and the key value only.
- Pass all fields to each row, so a resize needs no reload.

**Picture:** Size pair (Phone, 375; Window, 1280): The phone row shows a name and a date. The window row adds owner and size.

**See:** [5.16 Cap line length at 45 to 75 characters](https://www.designguide.dev/r/cap-line-length-at-45-to-75-characters.md)

### 5.20 Size a component by its slot  {#size-a-component-by-its-slot}

Default

**Rule:** Size a component by the width of its slot, not by the width of the window.

**Why:** A card in a narrow side pane is narrow, even in a wide window.

- Use the window class for the shell and the panes.
- Use the slot width for cards, rows, and charts.
- Test each component in the narrowest slot that it can fill.

**Picture:** Figure: The narrow card shows a title. The wide card adds a detail line.

## Input, density, and short windows {#s5-5}

### 5.21 Choose touch or pointer behavior from the input  {#choose-touch-or-pointer-behavior-from-the-input}

Hard

**Rule:** Choose touch or pointer behavior from the input in use, not from the width of the window.

**Why:** A laptop can have touch, and a tablet can have a mouse.

- Keep targets large while touch is in use (see [Rule 15.1](https://www.designguide.dev/r/size-targets-by-input-type.md)).
- Show hover extras only where hover exists (see [Rule 12.1](https://www.designguide.dev/r/let-hover-only-add.md)).
- Switch when the input changes, not at a width.

**Picture:** Do: A touch laptop keeps roomy rows in a wide window. Don't: A touch laptop gets dense rows only because the window is wide.

**See:** [15.1 Size targets by input type](https://www.designguide.dev/r/size-targets-by-input-type.md), [12.1 Let hover only add](https://www.designguide.dev/r/let-hover-only-add.md)

### 5.22 Offer two densities and save the choice  {#offer-two-densities-and-save-the-choice}

Default · Adapts

**Rule:** Offer a comfortable and a compact density in one control, and save the person's choice.

**Wide screen:** On a wide screen, put the density control in the toolbar of a dense list. (Triggers: Fine pointer, Dense data)

**Why:** Compact rows help a person who scans many rows with a mouse. They hurt a person on touch.  **When not:** A screen with a few large items needs only one density.

- Rule [3.16](https://www.designguide.dev/r/set-density-by-input-and-task.md) sets the default density by input and task.
- Keep targets 24 px or more, and 44 px for touch ([Rule 15.1](https://www.designguide.dev/r/size-targets-by-input-type.md)).
- Save the choice for the person, not for one window.

**Picture:** Size pair (Phone, 375; Window, 1280): The phone keeps comfortable rows. The window offers a compact table and a switch.

**See:** [3.16 Set density by input and task](https://www.designguide.dev/r/set-density-by-input-and-task.md), [15.1 Size targets by input type](https://www.designguide.dev/r/size-targets-by-input-type.md)

### 5.23 Keep the place when the screen turns  {#keep-the-place-when-the-screen-turns}

Default

**Rule:** Keep the place when the screen turns, and show only one bar in a window under 480 px high.

**Why:** A turned phone has little height. Two bars and a keyboard can leave no room.  **When not:** A task that needs one orientation, such as a camera or a game, may lock it.

- Keep scroll place, selection, and typed text through the turn.
- In a short window, hide the bottom bar or merge it with the top.
- Show two panes in a short window only when both fit.

**Picture:** Do: The window shows one bar above 3 workouts. Don't: Two more bars cover the window, hiding 1 of 3 workouts.

## Collapse and hidden functions {#s5-6}

### 5.24 Open the collapsed layout on the main job  {#open-the-collapsed-layout-on-the-main-job}

Default

**Rule:** When panes collapse to one, open on the pane with the main job, and reach the others by Back or a sheet.

**Why:** A person who lands on a menu of panes must hunt. The main pane answers the first question.

- Open on the list when the person picks an item first.
- Open on the detail when the person returns to one item.
- Put the inspector in a sheet.

**Picture:** Do: The one-pane layout opens on the order list. Don't: The one-pane layout opens on the sidebar menu.

### 5.25 Give hover and right-click functions a visible path  {#give-hover-and-right-click-functions-a-visible-path}

Default

**Rule:** Put each hover, right-click, and drag function in a visible control that touch and keyboard can reach.

**Why:** A touch screen has no hover, and a keyboard has no right-click.  **When not:** A shortcut or a hover extra may add speed, but it never holds the only path.

- Show the same function as a button or a menu item.
- [Rule 12.1](https://www.designguide.dev/r/let-hover-only-add.md) covers hover extras.
- [Chapter 15](https://www.designguide.dev/md/15-accessibility-and-input.md) covers touch and keyboard access.

**Picture:** Do: Each row has a More button for Rename and Delete. Don't: Delete lives only in a right-click menu. Touch cannot reach it.

**See:** [12.1 Let hover only add](https://www.designguide.dev/r/let-hover-only-add.md)
