Action
Everything the user presses: commands, links, navigation and choices. With href it renders a link, without one a <button>.
Other components
Examples
Commands
Named for what they do. The look follows from the meaning: deleting is destructive, cancelling is quiet.
<Layout intent="layout.actions">
<Action intent="action.cancel">Cancel</Action>
<Action intent="action.save">Save changes</Action>
<Action intent="action.delete">Delete</Action>
</Layout>Links
With href the same component renders a link.
Read the guide to intents before you add one.
<Text intent="text.body">
Read the <Action intent="action.navigate" href="/docs/what-is-an-intent">guide to intents</Action> before you add one.
</Text>On and off
pressed sets aria-pressed, and the intent styles the pressed state.
<Layout intent="layout.toolbar">
<Action intent="choice.filter" pressed>All</Action>
<Action intent="choice.filter" pressed={false}>Unread</Action>
<Action intent="choice.filter" pressed={false}>Starred</Action>
</Layout>The page you are on
current sets aria-current on navigation.
<Layout intent="layout.group" className="flex-row gap-5">
<Action intent="nav.page" href="#current-page" current>Overview</Action>
<Action intent="nav.page" href="#current-page">Activity</Action>
<Action intent="nav.page" href="#current-page">Settings</Action>
</Layout>An icon alone
Without visible text, label is required: it is the accessible name.
<Action intent="action.dismiss" icon={<X aria-hidden className="size-4" />} label="Dismiss" />Intents it renders
3 domains, each with its own page of neighbours and examples. The intent decides the element; these are the starter intents.
Action action.*
15 intentsaction.submitDoes what a form, dialog or step exists for: send, save, create, confirm, next, pay, and the submit of a form that begins something, like Sign up. Pass verb="save", "create", "pay"... to name it for analytics.
<button>action.startThe main action of a page or region that begins something: New project, Get started, Sign up, Start a trial. Pass verb="create", "signup"... to name it for analytics.
<a>action.cancelBacks out or says no without keeping anything: cancel, discard, decline an invitation, not now
<button>action.deletePermanently destroys data
<button>action.toggleTurns a state on or off and shows which: follow, subscribe, like. Pass pressed={on}
<button>action.commandDoes something and stays on the page: edit, add, remove, retry, share, open, back, refresh, duplicate, move, download, archive, sign out. The label says the verb; pass verb="duplicate", "archive"... to name it for analytics. Pass tone="danger" when it is destructive or hard to undo, like leaving a workspace.
<button>action.copyCopies a value to the clipboard: an ID, an API key, a link, a code snippet. Show that it copied
<button>action.dismissCloses or hides something without changing data: a dialog, notice or menu
<button>action.revealOpens a menu or shows content in place: the more-actions button on a row, show password, show more
<button>action.navigateGoes to another page or place, from inside a sentence or on its own: an inline link, Learn more, Terms, Forgot password?
<a>action.inspectOpens the details of a record in a table, on its name: the whole row opens it, while the other controls in the row, like its menu, still work on their own
<button>action.sortSorts a table by a column: the button inside its th. Put aria-sort="ascending" or "descending" on the th of the sorted column; the arrow follows it
<button>action.upgradeStarts or manages paying for more: upgrade, change plan, manage billing
<button>action.moreA link on its own to more about what is above it: Learn more, See all, Full changelog. Write only the words
<button>action.skipMoves to the next or previous item in a sequence someone steps through: the next track, the previous episode, the next photo in a dialog.media
<button>
Navigation nav.*
8 intentsnav.homeThe site or product name, linking to the home page
<a>nav.pageA link to a page in site or app navigation, including Sign in. Pass current on the page you are on
<a>nav.viewSwitches which view or panel of the same thing is shown: Following / For you, list / grid, a record’s Overview / Settings. Pass pressed on the active one
<a>nav.itemThe title of an item in a collection, opening its page. The link covers the item, so the whole item can be pressed; give the item position: relative
<a>nav.stepOne step in a multi-step flow. Pass current on the active step
<a>nav.pagingOne link in a layout.pager below a long list or table: a page number, Previous or Next. Pass current on the page shown
<a>nav.trailOne link in a breadcrumb trail of the pages above this one. Put them in a nav with aria-label="Breadcrumb" and pass current on the last
<a>nav.dotShows which item of a set is open, and opens that one, when the items have no titles: the photos in a dialog.media, the slides of a carousel. Pass current on the one shown, and a label like "Photo 2 of 5"
<a>
Choice choice.*
5 intentschoice.optionOne of a small set of values, exactly one of which is chosen: a theme, a size, a time slot, a plan. Pass pressed on the chosen one
<button>choice.filterNarrows which items are shown: All, Unread, a source. Pass pressed while it applies
<button>choice.colorPicks a colour from presets. Pass the colour as vars={{ "--choice-color": value }} and pressed on the chosen one
<button>choice.openShows what is picked and opens the choices to change it: a sort order, sources. The trigger of a Popover picker
<button>choice.bulkPicks a row to act on together with others: the checkbox at the start of a table row. Pass pressed while picked; show a layout.toolbar of actions while any are picked
<button>
Props
Plus its element’s usual attributes (id, onClick, aria-*, data-*) and the shared layout props below. No className or style.
intentrequiredhrefMakes it a link (through the
LinkComponentinconfig.ts, e.g.next/link).stringpressedOn or off, for toggles, choices and views. Sets
aria-pressed; the intent styles it.booleancurrentMarks the page or step you are on. Sets
aria-current; the intent styles it.booleaniconAn icon shown before the text, or alone.
ReactNodelabelThe accessible name. Required when there is no visible text (an icon alone).
stringdisabledTurns it off. A disabled link loses its
href.booleantypeButtons are
type="button"unless the intent says otherwise (action.submitissubmit).'button' | 'submit' | 'reset'verbThe verb this action performs, for analytics:
verb="duplicate"setsdata-verb. The intent stays the same.stringtoneFor an action that is destructive or hard to undo, like leaving a workspace. Sets
data-tone; the intent styles it.'danger'varsValues that come from data, as CSS variables the intent reads:
vars={{ '--accent': user.color }}.Record<`--${string}`, string | number>unsafeClassNameBypasses the intent. Needs a
// prongs-unsafe: <reason>comment on the line above, andprongs checkcounts it.string
Layout props
Where the element sits, never how it looks. Spacing between elements comes from the parent <Layout>.
alignOn text, the text alignment. On anything else, pushes it to that end of its row or column.
'start' | 'center' | 'end'widthFull width, or a maximum width.
'auto' | 'full' | 'prose' | 'sm' | 'md' | 'lg'hideBelowHidden on screens narrower than this breakpoint.
'sm' | 'md' | 'lg'showBelowShown only on screens narrower than this breakpoint.
'sm' | 'md' | 'lg'truncateOne line, cut off with an ellipsis.
booleannowrapKeeps the text on one line.
boolean
Rules
Name it for what it does (
action.delete), not how it looks.prongs checkwarns when its label or handler says something else.State goes in
pressedorcurrent, never in a different intent or extra classes.An icon alone needs
label.No
classNameorstyle.