Skip to content

Spacing and sizing

The spacing scale, the control height on the controls that take it, row heights and the sizes a phone uses.

Layouts line up across products because two things are fixed: the unit every gap is a multiple of, and the height every single-line control shares.

Spacing

Spacing is one base and its multiples. A class names the multiple, so p-4 is four of the base and gap-1.5 is one and a half.

Base
--spacing0.25rem4px
Set by
Tailwind. foundation leaves it as it is.
StepSizePixelsTo scale
0.50.125rem2px
10.25rem4px
1.50.375rem6px
20.5rem8px
2.50.625rem10px
30.75rem12px
41rem16px
51.25rem20px
61.5rem24px
82rem32px
102.5rem40px
123rem48px
164rem64px
205rem80px
246rem96px

Control height

Every single-line control is 30px tall on a desktop, so a button, a field, a select and a tab line up in any row without a nudge.

  • Button
  • Icon button
  • Input
  • Select
  • Input group
  • Toggle
  • Tab
The dashed lines are 30px apart.This screen is narrower than the item's desktop sizes reach, so these controls take the phone sizes further down.The item sets 30px from (min-width: 768px).
Size ofValueApplies
A single-line control: a button, a field, a select, an input group, a toggle
30px
(min-width: 768px)
An icon button, each way
30px
(min-width: 768px)
A tab trigger
30px
At every width
The track of a segmented control
30px
(min-width: 768px)
The gap between that track and its segments
1px
(min-width: 768px)
A segment in the track
28px
(min-width: 768px)

Rows

Rows are a step taller than controls, and the command palette's rows a step taller again. Under a finger every row grows to a full touch target.

A command list in a popover and a menu share one row height. The search on this site is the palette: its rows are the taller ones.
Size ofValueApplies
A row in a menu, a select list or a combobox list
32px
At every width
A command row in a popover
32px
At every width
A command row in the palette
40px
(pointer: fine)
The palette's search band
48px
At every width
A menu or command row under a finger
44px
(pointer: coarse)

On a phone

A phone has its own geometry. Rows and fields are 44px tall, and the text in a field is 16px, the size below which a phone's browser zooms in on a focused field.

Size ofValueApplies
A row in a menu
44px
(max-width: 767px)
A field
44px
(max-width: 767px)
A button in the foot of a dialog
44px
(max-width: 767px)
The text in a field
var(--type-body)16px
(max-width: 767px)

Breakpoints

The item defines no breakpoint and no container width of its own. It changes its sizes at one width, the one Tailwind calls md.

Phone sizes
(max-width: 767px)
Desktop control sizes
(min-width: 768px)
Tailwind's md
--breakpoint-md48rem768px