Principles

The rules the rest of the guidelines follow from. When a page is silent, these decide.

Content first, chrome quiet#

People live in these tools all day; the interface recedes so the work stays in front.

A log, a diff, a list of cards is what someone opened the app for. Toolbars, borders and badges are there to serve it, so they take the muted colours, the small sizes and the edges of the screen. A tag keeps its own colour, on a light fill: it tells tags apart, and asks for no more attention than the muted colours do. Give emphasis to one thing per view, the action most people came to take, and let everything else stay calm. Every extra border, shadow or colour competes with the content for the same attention.

Touch sizes for the toolbar icons

designreview

Alice

Good catch on the overlap. Can you push the gap-2 change to the branch?

A conversation from Mail. The subject and the message carry the weight; the toolbar is ghost icons in the muted colour, the tags are light fills of their own colours, and Send is the one filled button.

Dense with a pointer, generous with a thumb#

One look under every pointer; a coarse one adds the room a thumb needs.

A mouse can hit a 28px button all day, and a dense screen shows more of the work at once. A thumb cannot, so on a coarse pointer the same components, drawn the same, take that room by themselves: a hit area around each control, space between neighbours, rows tall enough to tap. Write one layout and let the components make the room; do not branch the app on screen width to pass bigger sizes. Density has the sizes and when to step down from them, Touch & mobile what a coarse pointer adds.

2 selected

Press Touch above the example: nothing is drawn larger, but the toolbar's buttons move apart and its bar makes room for their hit areas, with no change to the code.

Nothing only on hover#

Every action is reachable by keyboard and by touch.

Hover is a hint, never the only way in. A row's actions are on screen, or behind a visible ⋯ menu, rather than waiting for a hover that a keyboard and a thumb cannot give. In a control that is one Tab stop, a tree, the ⋯ shows on the current row, the focused one and the one under the pointer, and on every row on a touch screen, and Shift+F10 opens it. A selectable tree's checkbox shows on a row's icon only under the pointer, but it is a shortcut: Space selects from the keyboard, and the row's menu holds Select for a thumb and a pointer alike. A tooltip repeats a label the control already carries; it never holds the only copy. Every control can be reached with Tab and used with the keys a native control would take.

Tab to Mail's thread toolbar and walk it with the arrow keys: the bar is one Tab stop. Each tooltip opens on focus as it does on hover, and repeats the button's name with its shortcut; More actions opens with Enter or Space.

Whatever has an address is an a[href]; the app takes over a plain click and no other.

A folder, a section, a file, an open item: anything the reader can go to has a URL, and the control that goes there is a link to it. The browser then does the rest by itself. A middle click or ⌘/Ctrl-click opens it in a new tab, Shift-click in a new window, the context menu copies its address, and hovering it shows where it leads. A button that calls the router does none of that. An app that moves in place keeps the link and takes over only the plain left click, through its router's link passed with asChild or isPlainClick from @orz/ui/lib/link.

What acts rather than goes stays a button: Archive, Save, a menu's trigger. So does picking a row in a list box, which chooses in place, and a place held only in app state, with no address to give; a hash (#profile) is often address enough to make it a link. Navigation has the components.

Click a folder and it opens here, as an app's would. Middle-click it, or open it from the context menu, and Mail opens on that folder in a new tab.

Undo over confirm#

Confirm only what cannot be undone.

A confirmation dialog asks a question people learn to answer without reading. For an action that can be taken back, act at once and offer Undo in a toast. Keep the dialog for the few that cannot: deleting what no one can restore, sending what cannot be unsent. Then name the thing and the consequence, and make the destructive button say what it does.

  • Release 0.9.0: changelog draft
  • ci-runner

Archive the conversation: it goes at once, and Undo in the toast brings it back. Revoking the token cannot be taken back, so Settings asks first, and names the token and what stops working.

The theme is the user's#

No hard-coded colours; every surface reads the tokens.

People pick a theme to read comfortably, in a dark room, in sunlight, with low vision. An app that writes #fff or text-gray-500 breaks that choice in one place and nobody notices until a user in a dark theme does. Draw with the colour tokens, and let theming do the rest.

CI #1284
retry-once Failed
  • Lint5s
  • Build11s
  • Test7s

The checks of a pull request's CI run, drawn only with tokens. Pick another theme from the site's theme menu, light or dark, and every surface, border and status colour follows.

Say what happened#

Loading, empty, failed and done each look different and say so.

A blank area could mean any of four things, and the user should never have to guess which. Loading shows the shape of what is coming; empty says there is nothing yet and how to add something; failed says what went wrong and offers a retry; done says so once, briefly, and gets out of the way. A state that cannot be told apart from another is a bug.

Mail's Drafts in each state. Done is the toast under Undo over confirm above: one line, and gone again.

Shown, not told#

The interface says nothing it already shows; an explanation waits behind (i).

A label, a control's state, a Save button that is there or is not: the screen already tells the reader most of what a sentence under it would. Write that sentence anyway and every row grows a line of grey text the reader learns to skip, taking the one line that mattered with it. So no subtitle restates its heading, and no "Changes apply at once" sits over switches that do. What a reader may need and cannot see, what a setting does or why an option is there, goes behind an InfoPopover right after the label it explains: one press away with a mouse, a thumb or the keys.

Words that report stay on screen: an empty, failed or done message (Say what happened), a field's error, and a limit the reader needs while typing. Writing draws the line.

Two of these settings need a word on what they do, and carry it behind their (i); Line numbers says it all in its name. Press an (i), or Tab to it and press Enter.

In the demos