Layout
Page regions and groups. The intent decides the element (<main>, <section>, <form>, <ul>, <li>) and the arrangement.
Other components
Examples
A form
layout.form renders the <form>, layout.field groups each field, layout.actions holds the buttons.
<Layout intent="layout.form" className="w-full max-w-sm">
<Layout intent="layout.field">
<Text intent="text.label" as="label" htmlFor="example-name">Name</Text>
<Field intent="field.text" id="example-name" />
</Layout>
<Layout intent="layout.actions">
<Action intent="action.save">Save</Action>
</Layout>
</Layout>A list
layout.list renders a <ul> and layout.item its <li>s.
Design review
Tomorrow, 10:00Release planning
Friday, 14:30
<Layout intent="layout.list" className="w-full">
<Layout intent="layout.item">
<Text intent="heading.item">Design review</Text>
<Text intent="text.meta">Tomorrow, 10:00</Text>
</Layout>
<Layout intent="layout.item">
<Text intent="heading.item">Release planning</Text>
<Text intent="text.meta">Friday, 14:30</Text>
</Layout>
</Layout>A box about one thing
A box with its own surface is an intent too, not a class.
Two-step sign-in
Ask for a code from your phone as well as your password.
<Layout intent="layout.panel" className="w-full max-w-sm">
<Text intent="heading.item">Two-step sign-in</Text>
<Text intent="text.body">Ask for a code from your phone as well as your password.</Text>
<Layout intent="layout.actions">
<Action intent="action.start">Turn on</Action>
</Layout>
</Layout>A notice
A message about the page, with a way to dismiss it.
Check your email to confirm your address.
<Layout intent="layout.notice" className="w-full">
<Text intent="feedback.info">Check your email to confirm your address.</Text>
<Action intent="action.dismiss" icon={<X aria-hidden className="size-4" />} label="Dismiss" />
</Layout>Intents it renders
One domain, with its own page of neighbours and examples. The intent decides the element; these are the starter intents.
Layout layout.*
42 intentslayout.pageA centred column of content. An app page has one; a marketing page may have one per full-width band
<main>layout.taskA page for one short task or one message, centred on the screen: sign in, reset password, a confirmation, not found, a link that has expired. Its headings, text and actions are centred; a form or section inside takes the full width
<main>layout.headerThe bar at the top of the site or app: the product name, its navigation and account controls
<header>layout.shellThe frame of an app with a sidebar: one layout.aside beside the main column. Used once, around the signed-in part of the app
<div>layout.asideContent beside the main column: a docs sidebar, filters, a table of contents
<aside>layout.footerThe site footer at the bottom of every page
<footer>layout.sectionA part of a page made of separate blocks, with or without a title: a section under its heading, the cards in a column, a panel’s contents
<section>layout.screenA whole screen with its own background, like a maintenance, sign-in or error page. It takes the page colours, so the page is not the app’s background
<main>layout.anchorA plain box with no look that positions what sits inside it: the anchor for a badge or a menu placed over an element
<div>layout.groupA few closely related elements kept together, e.g. a heading and its text
<div>layout.headlineContent at the start of a line and its controls at the end: a section’s title and its button, a panel’s title bar, a list entry with its actions. The controls drop below when the line runs out of room
<div>layout.introThe heading and short text that introduce a section, above its content: a section title and its lead, a block of cards’ introduction
<div>layout.splitTwo parts of one section side by side that stack on phones: an image beside its text, a form beside a preview. data-reverse puts the second part first on wider screens
<div>layout.lockupAn icon, avatar or logo beside its text: a person’s photo and name, an icon and its label. The text shrinks and wraps; the icon keeps its size
<div>layout.formA form: renders <form> and stacks its fields
<form>layout.fieldOne form field: its label, input, help text and error
<div>layout.actionsCommands side by side: a form’s buttons, a dialog’s choices
<div>layout.toolbarControls that act on the content below them: filters, views, refresh
<div>layout.detailsLabel and value pairs about one thing: an order’s totals, a booking’s What / When / Who, a record’s details. Renders <dl>; each pair is a <div> with a text.label as="dt" and its value as="dd"
<dl>layout.tableRecords with the same fields, compared across: members, invoices, API keys. Write plain thead, tbody, tr, th scope="col" and td inside, with no classes; data-off on a tr marks a row that is switched off. Use data-head="bar" when the table runs edge to edge in a panel with no padding. With more columns than fit on a phone, wrap it in a layout.scroller
<table>layout.scrollerContent wider than its column, which the reader scrolls sideways: a table with many columns, a long line of code, a board. Give it tabIndex={0} and an aria-label, so keyboard users can scroll it too
<div>layout.pagerThe row of nav.paging links below a long list or table. Give it aria-label="Pagination"
<nav>layout.dockA bar that stays at the bottom of the screen while the content under it scrolls or changes: the now-playing bar, a cart total, a long form’s submit button on phones
<footer>layout.listA list of items of the same kind: articles, people, notifications. Children are layout.item
<ul>layout.itemOne entry in a layout.list
<li>layout.panelA self-contained box about one thing: a sign-in box, a profile summary
<div>layout.collectionEqual items shown side by side as a grid: people to follow, featured sources. It fits as many columns as its own width allows, so it works in a sidebar as well as across a page; set columns from a breakpoint only when the count matters
<div>layout.noticeA message about the page or the account: check your email, password updated, your trial ends soon. Add an action.dismiss when it can be dismissed
<div>layout.toastA short message that appears over the page and leaves on its own, sometimes with one action: saved, could not send, undo. Holds one feedback.* line and at most one action
<div>layout.emptyWhat a region shows when it has nothing yet: an icon, a heading, a sentence and the first action
<div>layout.loadingStands in for content that is still loading: a full-width line of text unless you give it the shape of what will appear
<div>layout.dividerA break between two parts of the same content: groups in a menu, sections of a panel. Runs across whichever way its parent flows
<hr>layout.disclosureContent that opens and closes in place under a text.summary line: an FAQ answer, advanced settings
<details>layout.subnavA page with its own section nav beside its content: settings, account, a project’s admin. Put the nav first (a nav of nav.page links), then the content. On phones the nav sits above it
<div>layout.articleA reading column for a whole page: articles, documents, settings
<main>layout.teaserA box in a layout.collection that previews one page and opens it as a whole: its nav.item title covers the box
<div>layout.bandA full-width part of a marketing page with its content centred: a hero, a row of features, a call to action. Put a layout.page inside for the content width
<section>layout.chartA chart: a trend over time, a breakdown. Renders <figure>; put the chart's svg or canvas inside with a height, and a text.caption that says what it shows
<figure>layout.blocksAn amount shown as a row of blocks, like a battery: the more blocks filled, the more of it. Each block is a layout.blocks.cell, with data-on on the filled ones; data-tone="success", "warning" or "danger" on the row colours them by level. Give it aria-valuenow, aria-valuemin and aria-valuemax
<div>layout.blocks.cellOne block of a layout.blocks; data-on when it is filled
<div>layout.badgedAn icon or avatar with a status dot on its corner: a device and whether it is online. Put the icon first and a text.indicator last
<div>layout.overlayControls placed over a photo or video, like the arrows in a dialog.media, kept readable on any image
<div>
Props
Plus its element’s usual attributes (id, onClick, aria-*, data-*). className is for layout only.
intentrequiredWhat this region is:
layout.page,layout.form,layout.list...LayoutIntentclassNameLayout and spacing only: margins, sizes, flex and grid, gaps, padding, text alignment. Visual classes warn in development and fail
prongs check.stringhideBelowHidden on screens narrower than this breakpoint: the desktop half of a region built twice.
'sm' | 'md' | 'lg'showBelowShown only on screens narrower than this breakpoint: the phone half.
'sm' | 'md' | 'lg'alignPushes the region to that end of its row or column, like a group of controls at the end of a header.
'start' | 'center' | 'end'refReaches the rendered element.
Ref<HTMLElement>unsafeClassNameBypasses the intent. Needs a
// prongs-unsafe: <reason>comment on the line above, andprongs checkcounts it.string
Rules
The only component with a
className, and only for layout.Hide or show by screen size with
hideBelowandshowBelow, and push a region to one end withalign, rather than classes.A box that needs its own background or border is a different intent (
layout.panel,layout.notice), not a class.Pass
onSubmitto alayout.form.