Components
Button
Primary action trigger with multiple variants, sizes, and states. Renders a native button element.
Import
Usage
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | 'primary' | 'secondary' | 'ghost' | 'danger' | 'outline' | 'primary' | Visual style |
size | 'sm' | 'md' | 'lg' | 'md' | Button size |
loading | boolean | false | Show spinner, disables the button |
disabled | boolean | false | Disable interaction |
fullWidth | boolean | false | Stretch to container width |
children | React.ReactNode | — | Button content |
className | string | — | Additional CSS classes |
...rest | ButtonHTMLAttributes | — | All native button attributes |
Variants
| Variant | Use case |
|---|---|
primary | Main call to action — one per view |
secondary | Secondary actions |
ghost | Tertiary/text-like actions |
danger | Destructive actions (delete, remove) |
outline | Bordered alternative to ghost |
Loading state
When loading is true, the button renders a spinner and sets aria-busy="true" and disabled to prevent double-submission:
Icon buttons
For icon-only buttons, provide an aria-label:
Accessibility
- Renders as native
<button>element — keyboard accessible by default - Enter and Space activate the button
loadingstate announcesaria-busy="true"to screen readersdisabledprevents interaction and announces to assistive technology- Use
aria-labelfor icon-only buttons