Button
A Base UI Button in three builds: the solid action, its outline twin and the text button.
import { Button } from '@fairgarden/design/actions/button'
Labels are a verb and an object, authored in title case. Handle presses with onClick; onPress is a deprecated alias kept for existing callers. A navigating action renders an anchor through render (with nativeButton={false}), keeping link semantics.
Variants and sizes
Variants and sizes
outline is the default; solid is the page's primary action; text carries a trailing glyph. Sizes run sm (32 px, hit area extended to 44), md (40 px, default), lg (48 px) and xl (56 px, the page's single transactional action). icon adds one functional glyph; iconOnly hides the label, which stays the accessible name. A disabled button draws a dotted edge. The keyboard focus ring is 2 px at a 2 px offset; a text button, which has no container, draws it around a box as tall as its size's other buttons, so its ring sits around the words at the same height as theirs (in running text it keeps to the line, 4 px out). Only the ring changes: the words and the hit area don't move.
Clicked 0 times
Primary and secondary
Primary and secondary
The solid fill is the scope's action scale until secondary overrides it. Outline edges, labels and the focus ring are primary roles, so primary recolors them.
On grounds
On paper, forest and leaf
The same two buttons on three grounds. On forest the action stays amber; on leaf, a solid ground with one ink, it becomes the ink pill.
Destructive actions
Destructive actions are red
Any action that destroys (delete, remove, discard, clear) takes destructive, and every variant turns red. solid takes the danger fill: --red11 with a --red1 label in light scopes (light steps 9 and 10 can't carry text), --red9 with --red1 in dark ones; its hover moves to --red12 in light and --red10 in dark. outline takes the danger edge and label, and text the danger label and glyph. On the fields the edge is --red12; on leaf, clay and royal, where red text falls below 4.5:1, the label keeps the field's ink and the red stays in the edge and glyph. Focus and pressed are unchanged.
API Reference
A Base UI Button. A navigating action renders an anchor through render
(with nativeButton={false}), keeping link semantics. States come from
Base UI and ARIA attributes only: pass disabled (with
focusableWhenDisabled where the reason matters) or aria-busy together
with an authored “-ing…” label; a busy button holds its rest width and
ignores clicks.
| Prop | Type | Description |
|---|---|---|
butted | | Butts the button against an adjacent field on its |
destructive | | Marks a destructive action (delete, remove, discard, clear): the
danger (red) roles replace the action and primary inks in every
variant [D192]. |
icon | | One optional functional glyph (§6.10), inline tier, FILL 0. |
iconOnly | |
|
iconPosition | | Which side of the label the glyph sits on (a |
onMedia | | Only with |
onPress | | Called on click, after |
primary | | Primary Radix scale, from the primary roster: the outline edge, labels and focus ring. Never defaulted; omitted, it inherits the scope [D133]. |
secondary | | Secondary Radix scale: the |
size | | Fixed height: |
variant | |
|
children | | The label: verb plus object, authored in title case [D160]. |
button
ButtonProps
Specification: DESIGN-SYSTEM.md §9.2 (button), §1.11.10 (the reference Button) and D192 (destructive actions).