Layout

How layout works, designed outside-in: the two frames you design on, the shell that divides the viewport, the container that is your real canvas, the grid that divides it, the max widths that cap content, and the Figma-to-code mapping that keeps what you draw identical to what ships.

What you design on

2 frames

You design two frames, not seven breakpoints: a mobile frame at 375 and a desktop frame at 1440. The seven breakpoints are code’s dial: lg (1024px) is the only moment the layout changes shape, and content caps at 1280px, so wider frames add margin, not design. Everything on this page exists so that what you draw at these two sizes is exactly what the browser builds.

Frame
Panels
Content margins
Content width
Mobile · 37516px each side343px
Marketing · 1440112px each side1,216px
Application · 1440280px left312px left · 32px right1,096px
App + right panel · 1920280px × 2352px each side1,216px

Design represents the build

Every number in that table is measured from the shipped code: the shell’s 280px sidebar (w-70), the container’s px-4 / lg:px-8 gutters, and the 1,280px max-w-container cap. If theme.css changes, these numbers change with it; the live tables below always carry the current truth.

The shell: persistent UI and main

The shell is the persistent UI that frames your content: the navigation sidebar, top bars, and side panels that stay put while the page scrolls (you’ll sometimes hear this layer called chrome). An application shell is persistent UI plus a scrolling main: the shell divides the viewport, the sidebar holds at 280px from lg up, an optional right panel for global tools follows the pinning rule below, and main takes everything left. You design what happens inside main; the system owns the frame around it. A marketing page drops the persistent UI and stacks full-width bands instead. Drag the viewport and watch the division happen.

1440px
Viewport1440px
Breakpointxl
Sidebar280px
Right panelnone
Main column1160px
Container1160px (fluid)
Content1096px
sidebar · 280px
content · 1096px

main (1160px) is under the 1280px cap: the container is fluid and fills it

The right panel (application shell only)

An application shell may add a second fixed panel on the right for global tools and widgets, the same 280px width as the navigation sidebar. Its one rule: it never squeezes the main content. The panel pins to the right edge of the browser only when there is mathematically room for it beside uncompromised content: sidebar + content cap + panel, which is 280 + 1,280 + 280 = 1,840px of viewport with today’s tokens. Below that, the panel docks behind an icon in the top-right of the header and opens as a drawer overlaying the main content (never pushing it) and closes back out of the way. When both panels are pinned, the content centers between them. Toggle the right panel in the simulator and drag across 1,840px to watch it dock and pin.

sidebar
header
section
section
section

Application shell · sticky sidebar + scrolling main

nav
hero
section
footer

Marketing page · full-width bands, contained content

The container: your actual canvas

Main is not your canvas; the container inside it is. Every page region wraps its content in max-w-container mx-auto px-4 lg:px-8: fluid until the main column passes 1,280px, then capped and centered. Drag the simulator above past ~1,580px in application mode and watch the container stop growing; that is the only sense in which sidebar and container widths ever add up. The variables below hold the container’s measurements, measured live from the tokens.

Name
Tailwind
Size (16px base)
Pixels
Size
px-41rem16px
lg:px-82rem32px
max-w-container80rem1,280px

Dividing the canvas: the grid

How do sibling blocks share the canvas? Proportionally, on a grid. Figma’s 12-column layout grid maps one-to-one to grid-cols-12 plus col-span-*; a span is a fraction of the container, so the layout redistributes as the container changes, and a span keeps meaning half or a third at any width. There is no single global gutter in code: gaps come from the spacing scale per layout, so set your Figma gutter to the gap you intend to spec.

You want
In Figma
In code
Columns to design onLayout grid · 12 columnsgrid grid-cols-12
A block half the canvas wideSpan 6 of the 12 columnscol-span-6
Full width on phone, half on desktop375: span 12 · 1440: span 6col-span-12 lg:col-span-6
Space between the columnsGutter = the gap you specgap-4 16 · gap-6 24 · gap-8 32
main · col-span-8
aside · col-span-4

Two thirds + one third: main (col-span-8) and aside (col-span-4), stacking to full width on mobile

Capping content: max widths

How wide may one block get, regardless of layout? A max width is an absolute ceiling tied to the content: below it the block stays fluid and keeps shrinking with the viewport; at it, the block stops growing. In Figma this is a fixed-width block centered in its region; in code it is w-full max-w-* mx-auto, usually applied from a breakpoint (md:max-w-120) because mobile is full-width anyway. width-sm (480px) is the workhorse, covering hero leads, CTA rows, and form columns; the paragraph measure (720px, max-w-180) caps running prose.

Name
Tailwind
Size (16px base)
Pixels
Width
max-w-8020rem320px
max-w-9624rem384px
max-w-12030rem480px
max-w-14035rem560px
max-w-16040rem640px
max-w-19248rem768px
max-w-25664rem1,024px
max-w-32080rem1,280px
max-w-36090rem1,440px
max-w-400100rem1,600px
max-w-480120rem1,920px
max-w-18045rem720px

The two tools compose. Below, the grid gives the main region two thirds of the canvas; the form column inside it stops at 480px no matter how wide that region grows. The unused space stays visible; that is the cap doing its job.

main region · col-span-8
form column · max-w-120 (480px)
aside · col-span-4

A 480px form column (max-w-120) inside a two-thirds main region: the grid shares space, the cap protects content

Don’t fake one with the other

Don’t fake a cap with col-span; a proportion drifts as the container changes. Don’t fake columns with side-by-side caps; they don’t distribute space or sit on the 12-column rhythm. The grid decides a region’s share; a max width protects the content inside it.

Breakpoints

7 steps

Breakpoints measure the viewport, never the main column: at a 1,280px viewport with the sidebar open, an xl: style is active even though main is only 1,000px wide. That is why lg (1024px) is the moment that matters: it is when the sidebar appears and the gutters widen, and why your two frames are the mobile base and 1440. The full scale below is code’s reference. The recipes under it show what a breakpoint change actually looks like: each pair is the same layout drawn at both of your frames.

Prefix
Min width
Rem
What changes
Width
320px20remKit addition for the smallest phones; currently unused.
600px37.5remKit addition matching Sonner’s toast breakpoint.
640px40remFirst density step: galleries widen, stacks go horizontal.
768px48remThe kit’s workhorse for component-level switches.
1,024px64remThe desktop moment: sidebar, wider gutters, app layouts.
1,280px80remMatches the container max width; rare in components.
1,536px96remAlmost never needed: content caps at 1280px.
375
1440

Stacks become rows · flex-col lg:flex-row

375
1440

Grids get denser · grid-cols-2 sm:grid-cols-3 lg:grid-cols-6

375
1440

Navigation moves · top bar on mobile, sidebar from lg

375
1440

Margins widen · 16px (px-4) to 32px (lg:px-8)

Layout inside components

The same system at component scale, and the strongest Figma-to-code bridge in the kit: auto layout is flexbox. Vertical auto layout with a gap is flex-col gap-*; horizontal with centered alignment is flex items-center gap-*; small form grids are grid gap-* sm:grid-cols-2. Gaps always come from the spacing scale: a 12px auto-layout gap is gap-3, never an ad-hoc margin.

You do in Figma
The system builds it with
Auto layout · vertical, gap 12flex flex-col gap-3
Auto layout · horizontal, gap 12, align centerflex items-center gap-3
Auto layout padding 16p-4
Fixed 480 block, centered in its regionw-full max-w-120 mx-auto
Hug contents / fill containerw-max / flex-1 or w-full

Stack · flex flex-col gap-3

Row · flex items-center gap-3

Form grid · grid gap-3 sm:grid-cols-2

A screen, torn down

this page

This page, read the way the system reads it. Every layout decision on the screen you are looking at is one of the tools above, numbered in the schematic and named in the legend.

1
title + anchor bar2
intro · col-span-63
prose · max-w-1804
table / demo5
  • 1Persistent UI. The sticky 280px sidebar (w-70): the shell divides the viewport before anything else happens.
  • 2The container. max-w-container mx-auto px-4 lg:px-8. Every block below sits inside it.
  • 3The grid. Section intros are grid-cols-12 with the text on col-span-12 lg:col-span-6 (half the canvas on desktop, full width on mobile).
  • 4The measure. Body copy caps at max-w-180 (720px) for line length.
  • 5The spacing scale. gap-28 between sections, gap-10 within them, gap-6 between demo and table; every gap is a step, never an ad-hoc margin.