Skip to content
Dumb UI

Search Dumb UI

Jump to a page or component, or switch the style

Search Dumb UI

Jump to a page or component, or switch the style

Button

Triggers an action. Six variants, six sizes, a loading state that keeps its width, and asChild for links.

ActionsDumb extras
Props
$ pnpm dlx shadcn@latest add @dumb/button

Needs the @dumb registry in components.json and the style tokens. See Installation.

import { Button } from "@/components/ui/button"
<Button>Continue</Button>

Variants

Same six variants as shadcn/ui. Each style decides what a variant feels like when pressed.

Loading

loading blocks interaction, sets aria-busy and holds the button's width. loadingText swaps the label.

With icons

Icons size themselves; icon sizes make square buttons.

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

PropTypeDefault
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"
asChildboolean

Render the child element with button styling.

false
loadingextraboolean

Shows a spinner, sets aria-busy, disables the button and keeps its width.

false
loadingTextextraReactNode

Label shown next to the spinner while loading.

-
Enter
Activates the button.
Space
Activates the button.