Button
An action trigger with default, outline, secondary, ghost, destructive, and link variants.
When to use
- Use when
- Triggering an action: submitting, saving, opening, or confirming.
- Avoid when
- Navigating to another page; use a link, which can look like a Button.
Installation
The source lands in src/components/ui/button.tsx, along with any Shelf items it builds on, and .shelf/lock.json records what was installed. It's yours to edit.
Usage
Examples
Sizes
With icon
Icons sit before or after the label. Icon-only buttons need an accessible label.
Loading
Disable the button and show a Spinner while the action runs.
Built on
- Packages
@base-ui/react,@stylexjs/stylex- Shelf items
foundations,utils- Accessibility
- Focus, keyboard, and ARIA behavior come from Base UI.
- Figma
- In progress. See Designers and Figma.