Button
The control that runs something: a submit, a mutation, an overlay opening. The intent says what kind of action it is, and the theme decides what that looks like for the tenant.
Reach for it
Firing an action: submitting, opening an overlay, running a mutation.
Not for
Navigating. That is a Link, which the browser can open in a new tab.
Intents
An intent names the weight and the consequence of the action, never a colour. Primary is the one action a screen is for, secondary is everything beside it, and danger is reserved for something the user cannot undo. Plain carries the behaviour and nothing else, for a trigger whose content is already a designed thing.
Sizes
Medium is the default and suits a form or a page action. Small belongs in dense rows such as a table toolbar. Square is for a single glyph, and it still needs an accessible name. It takes that glyph through iconLeft, so the intent colour reaches it.
Icons
An icon is a component, never a rendered element, so the button sets the size and the colour. That is what stops two buttons in a row from disagreeing about their glyphs. The label names the action, so the glyph stays decorative. A button that carries only a glyph is size="square" with an aria-label.
States
isLoading draws the spinner and blocks the press, so a submit cannot fire twice. Full width is a variant rather than a wrapper, because a button that stretches is a decision about the button.
Rendered as a link
Pass render when the action is a destination and you want it to look like a button. It stays a real anchor, so middle click, open in a new tab and copy link address all work. For a link that should look like a link, use Link instead.
API reference
Button
| Prop | Type | Default | Description |
|---|---|---|---|
| intent | 'primary' | 'brand' | 'secondary' | 'danger' | 'success' | 'warning' | 'info' | 'ghost' | 'link' | 'plain' | primary | |
| size | 'small' | 'medium' | 'large' | 'square' | medium | |
| isFullWidth | boolean | false | |
| render | ReactElement<{ children?: ReactNode }> | - | Renders your own element with the button's styling. An anchor stays a real link, so it keeps middle click, open in a new tab and copy link address. |
| isLoading | boolean | - | Disables the button, announces the busy state, and swaps the label for a spinner. The label keeps its space rather than unmounting, so the button does not resize under the pointer that just pressed it. |
| iconLeft | IconProps['icon'] | - | A glyph before the label, sized and coloured by the button. Decorative: the label names the action, so the icon is hidden from assistive technology. A button whose only content is a glyph is `size="square"` with an `aria-label`, not this. |
| iconRight | IconProps['icon'] | - | A glyph after the label, sized and coloured by the button. For a direction or a disclosure, such as the chevron on a step that moves the flow forward. Decorative, like `iconLeft`. |
Also takes the props of Base UI Button, minus className, style and render.