Skip to content

Structure

Spacing, page layout, and breakpoints — how UI sits in the viewport.

Structure covers the 4px spacing scale, content widths and grids, and the min-width breakpoints that change layout. Prefer these tokens over arbitrary padding, track sizes, or media queries.

px-4 · md:px-10 · lg:px-14

Content

max-w-5xl

Spacing

Driven by --spacing at 0.25rem (4px). Prefer p-4, gap-3, and space-y-6 over arbitrary values. Click a row to copy a padding class.

Preview

Step

Usage

StepValueUsage
0.50.125rem (2px)Hairline gaps, icon optical tweaks
10.25rem (4px)Tightest stack spacing, badge padding
1.50.375rem (6px)Compact control gaps
20.5rem (8px)Default inline gaps, small padding
2.50.625rem (10px)Dense list row padding
30.75rem (12px)Control padding, form field gaps
41rem (16px)Default section padding, card padding
51.25rem (20px)Comfortable panel padding
61.5rem (24px)Section gaps, spacious cards
82rem (32px)Large section spacing
102.5rem (40px)Page block gaps
123rem (48px)Major section separation
164rem (64px)Hero / page rhythm
RoleTypical stepsExamples
Inline / control1 – 3Icon + label gaps, badge padding, dense rows
Component padding3 – 5Buttons, inputs, cards, menu items
Section rhythm6 – 12Stacked sections, page blocks, form groups
Page / hero10 – 16Major separations and first-viewport breathing room

Widths and grid

Docs pages center content with a max width, then pad the main column with responsive gutters. Grids handle multi-column regions without inventing custom track sizes.

Content widths

NameClassValueUsage
Prosemax-w-3xl48rem (768px)Guidelines, descriptions, and long-form copy
Docsmax-w-5xl64rem (1024px)Default foundation and component pages
Widemax-w-6xl72rem (1152px)Wide galleries (e.g. color palettes)

Shell measures

NameClassValueUsage
Sidebarw-6015rem (240px)Docs navigation column
Gutter (mobile)px-41rem (16px)Main content horizontal padding below md
Gutter (md)md:px-102.5rem (40px)Main content padding from md
Gutter (lg)lg:px-143.5rem (56px)Main content padding from lg

Grid patterns

1
2
3
4
5
6
7
8

grid grid-cols-2 gap-3 sm:grid-cols-4

PatternClassUsage
Two columngrid gap-4 md:grid-cols-2Intro cards, paired previews, split content
Four columngrid grid-cols-2 sm:grid-cols-4Icon galleries and dense tile grids
Auto fillgrid gap-4 grid-cols-[repeat(auto-fill,minmax(12rem,1fr))]Responsive card collections without fixed breakpoints

Breakpoints

Mobile-first min-width steps. Base styles apply below the first step; each prefix applies from that width upward via --breakpoint-*.

Active viewport

min-width scale

xs

380px

sm

576px

md

768px

lg

1024px

xl

1280px

2xl

1536px

NamePrefixMin widthUsage
xsxs:380px (23.75rem)Large phones — earliest responsive step
smsm:576px (36rem)Small tablets / large phones landscape
mdmd:768px (48rem)Tablets — docs sidebar appears
lglg:1024px (64rem)Laptops — wider gutters and layouts
xlxl:1280px (80rem)Desktops — roomy multi-column layouts
2xl2xl:1536px (96rem)Wide desktops — max canvas

Common patterns

PatternClassesNotes
Docs sidebarhidden md:blockNav docks from md; TopBar handles smaller viewports.
Page gutterspx-4 md:px-10 lg:px-14Padding steps up with available width.
Two-column gridsgrid-cols-1 md:grid-cols-2Stack on small screens; split from md.
Dense galleriesgrid-cols-2 sm:grid-cols-4Earlier column increase at sm for tiles.

tsx

<div className="grid grid-cols-1 gap-4 md:grid-cols-2">
  <section></section>
  <section></section>
</div>

Usage guidelines

Do

  • Use spacing scale utilities (gap-4, p-3, mt-6)
  • Wrap page content in max-w-5xl (or max-w-6xl for wide galleries); keep guidelines to max-w-3xl
  • Write mobile-first, then layer sm: / md: / lg:
  • Match shell behavior: sidebar at md, wider gutters at lg
  • Keep diagrams in neutrals (bg-fg-primary, bg-background-tertiary)

Don't

  • Don't use arbitrary spacing like p-[13px] or custom breakpoints like min-[900px]:
  • Don't stretch unbounded content across ultra-wide viewports
  • Don't design desktop-first and override everything downward
  • Don't change layout at every breakpoint — reserve jumps for real structure changes