Grid

The columns and gutters a page sits on, at every width.

Rules

  1. grid-layout-tokens MUST Use --container, --sidebar, --toc and --topbar for layout widths; never a raw number. Because a raw width drifts from the shell, so the page edge no longer lines up with the header and nav.
    • Correct: <div className="max-w-(--container)">
    • Wrong: <div className="max-w-[1120px]">
  2. grid-no-sideways-scroll MUST Keep the page from scrolling sideways at 320px; tables and code scroll inside their own container. Because one wide table makes the whole page pan, and on a phone the person loses the nav and the first column together.
    • Correct: <CodeBlock code={longCommand}/> // scrolls inside
    • Wrong: <main><pre>{longCommand}</pre></main>
  3. grid-full-bleed SHOULD Break a full-bleed section out of the container and return its content to the container on the same gutter. Because content that rides the bleed edge no longer lines up with the text above and below it.
  4. grid-measure SHOULD Stop prose at --measure (68ch); tables, previews and grey panels take the full column. Because lines past about 70 characters make the eye lose its place on the return.
  5. grid-lines-clear NEVER Set content on a drawn grid line; guides are ink at 8% along the container edges. Because a line through text or a control reads as a strike-through or a border the element does not have.
    • Correct: <div className="px-6"><h2>Runs</h2></div>
    • Wrong: <div className="border-l border-hair pl-0"><h2>Runs</h2></div>

Tokens

TokenRoleUse forNot forLight
--containermarketing and docs content widthmarketing and docs content widthapp panels1120px
--sidebarapp and docs sidebar widthapp and docs sidebarcollapsed icon column248px
--tocdocs on-this-page columndocs on-this-page columnsidebar200px
--topbarapp and docs top bar heightapp and docs top bar heightcontrols56px
--gutterpage gutter at desktoppage gutter at desktopphones24px
--gutter-smpage gutter on phonespage gutter on phonesdesktop16px
--control-xsthe action in a 40px header, 8px from its edgesbutton xs, chip xs, segmented xs, filter bar xs24px
--control-smsmall control height, the sm of every controlbutton sm, chip, segmented sm, field sm, tag input28px
--controldefault control height, wider than tall: 16px of padding a sidebutton, input, select, slider thumb32px
--taga tag's height: the smallest box that holds a 12px label, a count or a key capbadge, code tag, kbd, ink slot sm, sidebar count20px
--control-lglarge control and touch targetbutton lg44px
--overlay-smsmall dialog and confirm widthdialog sm, alert dialog400px
--overlaydefault dialog, sheet and drawer content widthdialog, sheet, drawer480px
--overlay-lgwide dialog for forms and previewsdialog lg640px
--popoverpopover and picker panel widthpopover, mode picker288px
--toast-widthtoast stack width from 640px up; full width belowtoaster384px
--popover-sma short info panel opened from an info buttonpopover info256px
--tooltip-maxtooltip line length before it wrapstooltip, chart tooltip256px
--hint-widthwidest a full-text hint grows; still capped at the viewport less the phone gutterstruncate hint420px
--menu-minnarrowest a menu opens, so short labels still give a usable target rowdropdown menu, filter bar menu, attachment row192px
--popup-maxtallest a list popup grows before it scrollsselect, combobox, command list, prompt-input menu, chart data table320px
--menu-widthwidth the @ and / list opens at beside the caret; narrower on a phoneprompt-input menu320px
--field-max-heighttallest a wrapping chips field grows, four touch rows, before it scrollscombobox chipscalc(var(--control-lg) * 4)
--row-smcompact row, for dense datatable size sm32px
--rowdefault row, one linetable, item40px
--row-lga row with a second linetable size lg, item with a description56px
--label-columnwidest a description-list label column grows before it wrapsdata list160px
--measurelong-form reading measurelong-form reading measuretables68ch
--tab-maxwidest a document tab grows before its title truncatestabs document variant220px
--sidebar-iconcollapsed sidebar width: one control plus 8px a sidesidebar icon modecalc(var(--control) + var(--space-4))
--attachment-mediathe media square in an attachment row; size sm uses 32px, --row-smattachment40px
--attachment-maxwidest an attachment chip in the composer grows before its name truncatesprompt-input attachment256px
--grab-sizelength of a sheet's grab barsheet40px
--fade-edgethe mask fade at the clipped edge of a sideways scrollersuggestions scroll24px
--fade-line-endthe mask fade at the end of one line of text that overflows, in place of an ellipsissegmented control label16px
--measure-hinta description under a title, a page lede or a field's hint, shorter than prosefield description, section description, page header description60ch
--measure-shortan empty state's title and line, set top-left in the bodyempty state48ch
--page-header-maxwidest a page header's title block grows beside its actionspage header720px
--search-minnarrowest the filter bar's search gets before the filters wrap under itfilter bar200px
--search-maxwidest the filter bar's search grows once the bar has roomfilter bar320px
--crumb-floorshortest the page crumb truncates to before the trail folds another crumbbreadcrumb trail8ch
--log-levelthe level column, as wide as the longest level wordlog viewer5ch
--status-columna right-aligned status column, wide enough for the status "Waiting on you"table, tool call, timeline128px
--timeline-namethe widest the name column of a timeline gets from 576px; narrower frames give it 40%, and never less than --timeline-name-mintimeline200px
--timeline-name-minthe least the name column of a timeline keeps, so a label never shrinks to a stubtimeline120px
--timeline-label-minthe least a span name keeps before its figure is hidden, so a name never shrinks to a stubtimeline10ch
--time-columna column of relative times, wide enough for the first paint's date ("Sep 30, 2025") so the swap to "3m ago" never moves itrelative time column12ch
--stat-placeholderthe loading bar standing in for a stat's value, about four digitsstat4ch
--tool-detail-minthe least of a tool call's detail kept before its status wraps to a second linetool call6ch
--line-boxone line of the text it sits in; lh resolves where it is readprose rhythm, stat, status, toast mark, date picker field, prompt input, tool call output1lh
--skeleton-texta text skeleton bar, about the cap height of the text it stands forskeleton text0.7em
--code-inlineinline code, a step under the text around it so mono does not look largercode0.9em

Decision table

You needUse
Page content width--container
Left navigation--sidebar
Side gutter--gutter, --gutter-sm on phones
Reading width--measure

Scale

12 columns, 20px gaps. Under 640px: 4 columns, 16px gutter. 640 to 1023: 8 columns, 24px.

Reject list

  • No raw pixel widths for layout.
  • No page-level horizontal scroll.
  • Space: How much room goes between things, in steps of 4px.
  • Typography: One sans for every word, mono for what a person copies.