Layout
Layout decides where things sit and how much room they get. Take widths from the grid and gaps from the spacing scale, and a screen holds together at any size.
The page grid
Pages sit in a frame with a fixed maximum width that stays centered on wide screens. Inside it, content lines up on columns separated by gutters, with side padding that keeps text off the edge of the window.
A reading page is a heading, running text and a figure or a table. The heading, the figure and the table may span every column. Running text keeps to its line length.
Below 1024 px the page is one column wide. In WerkOS, a board or a list fills the window up to 1600 px, and a form or a document stops at 768 px.
- Frame, maximum width
- 1440 px
- --frame
- Columns
- 12
- Gutter
- 24 px
- --gutter
- Side padding
- 24 px; 32 px from 1024 px
- --pad
- Product board or list
- up to 1600 px
- Product form or document
- up to 768 px
Spacing scale
Gaps come from one scale. It moves in steps of 4 px at the small end and in larger jumps as distances grow, so neighboring values stay easy to tell apart.
Measure a gap from the edge of one element’s box to the edge of the next. Half steps of 2, 6 and 10 px are allowed only inside a component, to center an icon optically. They do not set the space between components.
--space-14 px--space-28 px--space-312 px--space-416 px--space-520 px--space-624 px--space-832 px--space-1040 px--space-1248 px--space-1664 px--space-2496 px--space-32128 px
Space shows what belongs together
People read things that sit close as one group, and more space as a weaker bond. Inside a control, use 4 to 12 px, such as the 8px between a button’s icon and its label.
Between items of the same kind, such as a label and its field or the cards of a grid, use 8 to 16 px. Between groups inside a section, use 24 to 48 px.
Between the sections of a reading page, use 96 px, or 64 px on a phone. Draw no line there: the space already separates them.
Breakpoints
The layout changes at a few widths and holds between them. Choose by the width the window gives you, not by the device: a desktop window can be as narrow as a phone.
Below 640 px a board shows its rows as cards. From 1024 px the navigation rail appears, and the side padding grows.
On a touch screen, whatever its width, a target is at least 44 px and text you can edit is at least 16 px.
- Small
--breakpoint-sm640 px - Medium
--breakpoint-md768 px - Large
--breakpoint-lg1024 px - Extra large
--breakpoint-xl1280 px - This window
Line length
Keep running text between 45 and 75 characters a line. On a longer line the eye loses its place on the way back, and on a shorter one phrases break apart.
Keep running text between 45 and 75 characters a line. On a longer line the eye loses its place on the way back, and on a shorter one phrases break apart.
On a wide screen, a figure or a table may take the full width, but running text never does. A statement set large can, since its size keeps the line short.
On a narrow screen a paragraph holds its own measure.
Density
Work screens are dense, so people see more rows without scrolling. Reading pages are open, so long text stays comfortable.
Heights are minimums, so a row or a control grows when the reader enlarges text.
- Board row
- 36 px compact, 52 px comfortable, 76 px tall
- Toolbar control
- 36 px
- Form control
- 44 px
- Gap between cards
- 16 px
- --space-4
- Space between page sections
- 96 px; 64 px below 768 px
- --space-24
Permitted and not permitted
Permitted
Set widths in columns of the grid
A block spans columns, and the grid adapts at each breakpoint.
Take gaps from the spacing scale
Pick the step that matches how closely the items belong together.
Let a wide table scroll inside its own box
The page itself does not scroll sideways.
Not permitted
A fixed width on a paragraph inside a wide column
It squeezes the text into a strip and leaves the rest of the row empty.
Gaps off the scale, such as 18 or 22 px
They break the rhythm and drift from screen to screen.
A second vertical scroll area inside the page
Two scroll areas on one axis fight over the mouse wheel and trap keyboard users.