Skip to content

Layout, grid and hierarchy

How to arrange a screen on phones and desktops.

How a page is divided, how space groups things, and how people know where to look first. Numbers come from published systems where we could check them. Where we could not, we say so.

Screen sizes

Tattva has five screen size classes, with breaks at 600, 840, 1200 and 1600px. They match the Material 3 classes. Tailwind's sm, md, lg and xl use the same widths.

SizeWidthColumnsMarginGap between columnsTailwind
Compactunder 60041616base
Medium600 to 83981616sm
Expanded840 to 1199122424md
Large1200 to 1599123224lg
Extra large1600 and up123224xl

Margin is the empty space at the page edge. The gap between columns is called a gutter. Their values are the --margin and --gutter tokens, which change at 840 and 1200px. Grid switches its columns at md and lg by default (4, 8, 12). That is later than Material. Treat the table as the goal and pass cols to match it. This is a proposal to confirm.

What other design systems use

SystemScreen breaksColumnsOther
Carbon 2xsm 320, md 672, lg 1056, xl 1312, max 15844, 8, 16, 16, 1616px padding. 8px mini-unit with scale 8, 16, 24, 32, 48, 64, 80.
Material 3compact under 600, medium 600 to 839, expanded 840 to 1199, large 1200 to 1599, extra large 1600+4, 8, 12Margins 16dp compact, 24dp medium and expanded (snippets).
Atlassianxxs 320, xs 480, s 768, m 1024, l 1440, xl 17682, 6, 6, 12, 12, 12Gutter 12 then 16, margin 16 then 32 (snippet).
GOV.UKTablet at 641Width fractionsPage container 1020px.

Most systems use 4 columns on phones, 8 or 12 on tablets and 12 or 16 on desktop. Margins are 16 on phones and 24 to 32 on desktop.

Columns, margins and gaps

Container widths

Spacing and grouping

Making one thing stand out

Chat on smaller screens

Tight and roomy spacing

Text size and line length

Standard layouts

What we could not verify

Sources

Build your next AI screen with Tattva.

Free and open, with the code. Start in one line.

Get started