API and Development
Button is used to take action by clicking or pressing a specific key.
Name | Type | Default | Description |
|---|---|---|---|
|
|
| When true, applies an active/pressed visual state. |
|
|
| HTML element tag to render. |
|
| — | Additional CSS class name(s) applied to the element. |
|
| — | Brand-driven corner treatment; sharp removes rounding on non-link buttons. |
|
| — | Uncontrolled initial pressed state when |
|
| — | When true, disables interaction and applies a disabled visual state. |
|
|
| When true, opens the link in a new tab with |
|
| — | URL for link-type buttons. Only used when |
|
| — | Native |
|
| — | Accessible title for |
|
| — | Choose to inject interactivity into a child element such as a Div element |
|
|
| Visual style variant for the interactive element. |
|
| — | SVG icon displayed before the button label. Overridden by |
|
| — | Explicit loading indicator type. When provided, overrides the default behavior based on button state. If not provided, Loading state uses Loading indicator, Pending state uses Pending indicator. |
|
| — | Called when pressed state changes while |
|
| — | Controlled pressed state when |
|
| — | 0-100 determinate progress overlay on the leadIcon. Requires a leadIcon. Base color on Primary, Destructive, and Success types; Accent color on Secondary. Ignored when state is Loading or Pending. |
|
| — | — |
|
| — | Relationship for anchor-based interactables (for example |
|
| — | ARIA role attribute for the interactive element. |
|
|
| Button size variant. Takes precedence over |
|
|
| @deprecated Use |
|
| — | Button state (Loading/Success/Error). When set, overrides the leadIcon. |
|
| — | Status dot color. Allowed on all button types except Link. |
|
|
| When true, positions the status dot inset from the corner. |
|
| — | Overrides the default tab order for non-disabled elements. Pass |
|
| — | SVG icon displayed after the button label. |
|
| — | Target for anchor-based interactables (for example |
|
| — | Native HTML title attribute for browser tooltip fallback |
|
| — | When true, wraps the button in a standalone Radix Toggle ( |
|
| — | Optional tooltip text to display on hover (uses Radix Tooltip) |
|
| — | Position of the tooltip relative to the element, defaults to "top" |
|
|
| Enum for button appearance variants, don't use the string value. always use the enum |
|
| — | Brand-driven layout default override: tighter padding when compact. |
Interactive examples and edge cases for this component are in Storybook.
Use to designate key actions, such as accepting a condition that changes the product state. Allow one critical button per page; don't use alongside a primary button.
Use for important actions like saving or creating something new. Allow one primary button per page; don't use alongside a critical button.
Use in the interface for all actions except for those considered primary or critical.
Use occasionally as an alternative type to differentiate actions of lesser importance from those paired with primary and default buttons. Secondary buttons most often appear in buttons groups as the action of least importance.
Use to designate a link to another part of the product or an external URL. Set type={ButtonType.Link} and pass href so the control renders a navigable anchor.
Use to link to other parts of the platform. Internal links always open in the same browser tab.
Paired with an external link icon, use to link to external URLs only. External links always open in a separate browser tab.
Semantic or color-coded buttons give users a sense of their purpose without even having to read their label.
Use to indicate a constructive action or confirming a positive state (e.g., a completed process, approving an action).
Use to indicate a destructive action or confirming a negative state (e.g., deleting or removing something, taking an irreversible action).
A button with a downward-facing chevron as a tail icon, use in buttons with related actions instead of a button group. Split buttons can also include a lead icon.
As with color, sizing also conveys a button's place in a page hierarchy.
Use frequently for most actions. This is the default when size is omitted.
Use when you need a slightly shorter control than large without going to the compact size.
Use in tight spaces, such as sidebars and floating elements; only pair with other small-sized buttons.
Use to identify or differentiate the button's usage, such as a "+" icon when adding something.
Use to provide additional context about the button label or indicate what happens after clicking the button, such as an arrow "→" after "Next."
Use to indicate that an action is in process; reverts to the previous state when completed.
Use for unavailable actions. Always provide context (via tooltip or nearby text) for why the action is unavailable and how to enable it.
active forces open/selected styling without sustained aria-pressed. Prefer toggle when the control must remain pressed.
Opt in with toggle on non-link buttons. Wraps a standalone Radix Toggle (asChild) so the same button element gains aria-pressed and data-state. Controlled via pressed / onPressedChange, or uncontrolled via defaultPressed. Selected inset fill applies to ButtonType.Secondary when pressed. Filled types (Primary, Critical, SecondaryAlt, Success, Destructive) apply brightness(var(--brightness-active)) while data-state="on".
Do not use toggle inside a ToggleGroup; group items remain ToggleGroupItem.
loadingType overrides the spinner when state is loading or pending.