Button
Triggers an action. Six variants, six sizes, a loading state that keeps its width, and asChild for links.
Needs the @dumb registry in components.json and the style tokens. See Installation.
Loading
loading blocks interaction, sets aria-busy and holds the button's width. loadingText swaps the label.
As a link
asChild merges the button onto its child, keeping link semantics.
API reference
Props marked “extra” are Dumb UI additions. Everything else matches shadcn/ui.
Button
| Prop | Type | Default |
|---|---|---|
| variant | "default" | "secondary" | "outline" | "ghost" | "destructive" | "link"Visual weight of the action. | "default" |
| size | "default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg"Height comes from the style's --du-h-* tokens. | "default" |
| asChild | booleanRender the child element with button styling. | false |
| loadingextra | booleanShows a spinner, sets aria-busy, disables the button and keeps its width. | false |
| loadingTextextra | ReactNodeLabel shown next to the spinner while loading. | - |
- Enter
- Activates the button.
- Space
- Activates the button.