Button
A button, or anything drawn as one, with its words and icons as children, solid by default.
Usage
Examples
Appearances
appearance paints the button on the kit's one scale: solid, the default, then soft, outline and transparent for quieter actions.
Tones
tone sets the colour, neutral by default, accent, destructive, success, warning or info, and works with every appearance: a solid accent button is a form's main action, a solid destructive one deletes, a soft one warns. Where the host asks for solidLikeFields, a neutral solid button takes a field's look and accent stays filled.
Sizes
size sets the height from xs to lg, and a button holding only an icon is square at each of them.
Border radius
borderRadius sets the corners on the kit's one scale: none, xs 4px, sm 6px, base 8px, lg 12px, xl 16px, or full to round it, which makes a button holding only an icon a circle; base is the default at every size.
With icon
An icon goes in as a child, and data-icon="inline-start" or "inline-end" trims the padding on its side.
Icon only
An icon alone makes the button square at every size, and aria-label names it for a screen reader.
Loading
loading spins in place of the button's icon, or before its words when it has none, and holds off clicks until it is done; off is the default.
Wrap
A button keeps its words on one line by default; wrap lets long ones run onto more lines, the button growing with them, as a list of long choices does.
Block
block stretches the button across its row, as a form's last button or a menu's footer does, so a page never writes the width itself; by default it is as wide as its words.
Muted
muted writes the words in the muted grey, darkening on hover, on focus and while its menu is open, for quiet controls such as a breadcrumb or a social icon.
Align
align sets the words and icons at the button's start, centre or end when it is wider than them, as a block button is: start for the rows of a list such as a sidebar's or a list of suggestions.
Href
href makes the button a link to that address, opened through Next's link and drawn as a button; target and rel open another site in a new tab.
Disabled
disabled dims the button and holds off clicks, beside one as it is by default.
API Reference
Button
ButtonProps · components/Button/Button.types.tsIt also takes the props of <button>.