Button
Flat and raised buttons, icon buttons, and groups.
Appearances and variants
Use raised by default, flat in toolbars and repeated list actions, and outline next to a raised button. Use one primary per section for the main path. Use danger only for the final destructive act.
Sizes and states
Use md by default, sm in toolbars, table rows, cards, and status bars, and lg only for marketing hero calls to action. Click Save to see the loading state.
With an icon
icon goes before the label. iconPosition="end" moves it after. iconEnd adds a second icon.
Button groups
Buttons in a ButtonGroup take its appearance, variant, and size, and join edge to edge.
Usage
These are defaults, not laws. Break one when you have a good reason, or when it makes the design more cohesive or more interesting.
- Over images, video, or a canvas, use FloatingButton.
- Confirm actions that cannot be undone with an AlertDialog. Put danger on the confirm button in the dialog, not on the button that opens it.
- Use
loading, notdisabled, while a request runs. The width stays the same and the button stays focusable. - For navigation, use ButtonLink.
- To use a library button as a Base UI trigger, pass it to
render, for example<Popover.Trigger render={<Button />}>.
API
Props that the library adds. Every part also takes all the Base UI props.
Button
| Prop | Type | Default | Description |
|---|---|---|---|
| appearance | 'flat' | 'raised' | 'outline' | 'raised' | The shape: flat, raised 3D, or outlined. |
| variant | 'primary' | 'secondary' | 'danger' | 'secondary' | The meaning and color: brand orange, neutral, or destructive red. |
| size | 'sm' | 'md' | 'lg' | 'md' | Height and text size. |
| icon | ReactNode | – | An icon next to the text. |
| iconEnd | ReactNode | – | A second icon after the label. |
| loading | boolean | – | Shows a spinner and blocks actions. The width does not change. |
| iconPosition | 'start' | 'end' | 'start' | Which side of the text the icon goes on. |
IconButton
| Prop | Type | Default | Description |
|---|---|---|---|
| icon | ReactNode | – | The icon. Required. |
| loading | boolean | – | Replaces the icon with a spinner and blocks actions. |
| aria-label | string | – | The accessible name. Required. |
ButtonGroup
| Prop | Type | Default | Description |
|---|---|---|---|
| appearance | 'flat' | 'raised' | 'outline' | 'raised' | The shape: flat, raised 3D, or outlined. Sets it for every button in the group. |
| variant | 'primary' | 'secondary' | 'danger' | 'secondary' | The meaning and color: brand orange, neutral, or destructive red. Sets it for every button in the group. |
| size | 'sm' | 'md' | 'lg' | 'md' | Sets the size of every button. |
| disabled | boolean | false | Blocks every button and fades the group as one unit. |





