Back to Button
View full API on Button
Button
Sizes
Extra-small through large on the default scale.
API
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "solid" | "outline" | "soft" | "ghost" | "link" | "destructive" | solid | Visual style. |
| size | "xs" | "sm" | "md" | "lg" | "icon" | "icon-sm" | "icon-lg" | md | Height, padding and icon scale. |
| fullWidth | boolean | — | Stretches the button to fill its container. |
| asChild | boolean | false | Render the child element instead of a <button>, via Slot. |
| loading | boolean | false | Shows a spinner, disables interaction, hides leadingIcon, sets aria-busy. |
| loadingLabel | string | Loading | Screen-reader-only text announced while loading. |
| leadingIcon | React.ReactNode | — | Element rendered before the label. |
| trailingIcon | React.ReactNode | — | Element rendered after the label. |
| type | "button" | "submit" | "reset" | button | Native button type. Defaults to "button" so buttons inside forms do not submit accidentally. |
| disabled | boolean | — | Native disabled attribute. |
| className | string | — | Merged with the generated variant classes via cn(). |