Button
Button styled by a tone × emphasis grammar: tone sets the semantic colour
(neutral / brand / danger) and emphasis sets the visual weight (solid / soft /
outline / ghost / transparent / link). Any pairing is valid - there is no fixed
"primary/secondary" list; those looks are expressed as tone × emphasis pairs.
An icon-only button (an icon-* size, or icon with no children) requires an
aria-label; a dev-only console warning fires when it is missing. With render,
styling and icon/dot decorations are applied to the element you pass in.
Usage
Best practices
Express weight with
tone×emphasis, not avariantprop - there is no "primary/secondary"; e.g. the destructive confirm istone="danger".Icon-only buttons MUST have an
aria-label(a dev warning fires otherwise).Use
renderto render a link element (e.g.render={<Link href="…" />}) rather than nesting a button inside an anchor.loadingkeeps the button focusable while it blocks presses, so focus stays put across a submit; a plaindisabledbutton leaves the tab order.Reach for
emphasis="ghost"/"link"in toolbars/headers - they carrydata-edge-compso containers can pull them flush to the edge.
Props
Also exports
- const
BUTTON_EMPHASES - const
BUTTON_TONES - type
ButtonEmphasis - type
ButtonProps - type
ButtonSize - type
ButtonTone - const
buttonVariants
Composition
Used by
AlertDialog, Calendar, Carousel, ColorPalette, Combobox, CookieBanner, DataGrid, DataGridColumnFilter, DataGridColumnHeader, DataGridPagination, DeliveryBanner, Dialog, ErrorState, FileUploadDropzone, InputGroup, LocationInput, MobileNavigationRoot, PageToolbar, Pagination, ProductCard, PromptPanel, QuantityControl, QuickView, ScrollFrame, Select, SettingsCard, Sheet, Sidebar, Sidepanel, TagSelector, Toaster, LiveWaveform