A pressable trigger with spring-animated depth feedback, sound cues, and solid/outline/ghost/link variants.
Dependencies
Interaction Type
Press animates scale(0.97) + translateY(1px) via spring physics; hover shifts background color; sound cues on hover and click; loading state swaps content for a spinner while preserving width.
Props
Options you can pass to customize this component.
variantVisual style. Defaults to "solid".
sizeButton height and padding tier. Defaults to "md" (44px touch target).
destructiveApplies error-color styling appropriate to the current variant.
loadingShows a spinner, preserves width, sets aria-busy and disables interaction.
asChildMerge button styling onto the child element via the Slot pattern.
disabledDisables the button with reduced opacity and no pointer events.
classNameAdditional CSS classes merged via cn().
Installation
How to use
import { Button } from "@/components/ui/button"
export function Demo() {
return (
<div className="flex items-center gap-3">
<Button>Primary</Button>
<Button variant="outline">Outline</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="link">Link</Button>
<Button destructive>Delete</Button>
<Button loading>Saving…</Button>
</div>
)
}Source Code
Click the code icon in the top-right corner to view the source code.
License & Usage
// No code loaded.