Button
A tactile, award-grade button with press physics, cursor-tracked spotlight, hover sheen, loading state, and premium gradient / glass / success variants.
Installation#
pnpm dlx shadcn@latest add @davinciui/buttonUsage#
Loading#
Cursor#
Size#
Default#
Outline#
Secondary#
Ghost#
Destructive#
Link#
Icon#
With Icon#
Rounded#
Spinner#
Button Group#
As Link#
RTL#
API Reference#
| Prop | Type | Default |
|---|---|---|
variantVisual style of the button. | "default" | "destructive" | "outline" | "secondary" | "ghost" | "link" | "success" | "gradient" | "glass" | "default" |
sizeSize of the button. | "xs" | "sm" | "default" | "lg" | "xl" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | "default" |
loadingShows a spinner, announces via aria-busy, and blocks re-clicks. | boolean | false |
asChildRender as child via Radix Slot (e.g., as link). | boolean | false |
classNameAdditional CSS classes. | string | — |
styleAdditional inline styles. | CSSProperties | — |
Accessibility#
Renders a native button with a visible focus-visible ring; loading sets aria-busy and blocks clicks. The asChild path uses aria-disabled because anchors cannot be disabled, and the spinner is aria-hidden.
Motion#
Hover lift, 0.97 press scale, cursor spotlight and gradient sheen animate through 150ms cubic-bezier transitions. motion-reduce removes transitions, hides the pseudo-element effects and cancels the press scale.
Customization#
Use the variant and size props for the built-in styles, then layer layout or color classes through className. The button renders a single data-slot hook for targeted overrides.
Styling slots
[data-slot="button"]View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

