Button
Triggers an action or event, with variants for every level of emphasis.
- Foundations
- 1 file
- 2 npm packages
- Accessibility notes
Loading the example…
pnpm dlx @dowel-ui/cli add buttonnpm packages installed: class-variance-authority, radix-ui.
import { Button } from "@/components/ui/button";Default
Variants
Sizes
With Icons
Loading
Loading Across Variants
Disabled
As Link
Icon Only
Smooth Button
Depth Press
<Button>
| Prop | Type | Default |
|---|---|---|
loadingShows a spinner and suppresses activation. Unlike | boolean | false |
press | "scale" | "depth" | "none" | "scale" |
shape | "default" | "pill" | "square" | "default" |
size | "sm" | "md" | "lg" | "icon" | "icon-sm" | "md" |
variant | "primary" | "secondary" | "outline" | "ghost" | "destructive" | "link" | "soft" | "gradient" | "primary" |
asChildRenders the child element as the button instead of a | boolean | false |
Plus every attribute of <button>.
Keyboard activatable via Enter and Space. The loading state uses aria-disabled and aria-busy rather than the disabled attribute, so focus is never stranded mid-action. Use `size="icon"` only with an accessible name from aria-label or visually hidden text.
10/10
checks passed
- Tested — passes
- axe assertion — passes
- Keyboard tested — passes
- Storybook examples — passes
- Accessibility documented — passes
- Semantic tokens only — passes
- Motion from tokens — passes
- className merged — passes
- Visible focus — passes
- No fixed widths — passes
- Admin — users
- Admin dashboard
- Agent console
- AI Chat
- AI workspace
- Analytics
- API keys
- Billing
- Careers
- Command center
- Contact
- CRM
- CTA banner
- CTA centered
- CTA split image
- Footer Mega
- Footer Newsletter
- Forgot password
- Hero flow field
- Hero grid
- Hero light beams
- Hero minimal
- Hero perspective grid
- Hero product
- Hero split image
- Hero spotlight
- Login
- Logo links marquee
- Logo marquee
- Onboarding
- Pricing
- Pricing Single Plan
- Pricing Three Tier
- Pricing Two Tier
- Settings
- Sign up
- Site header
- Team carousel
- Testimonial Rotator