Jump to a page or a component.
Six roles, eight sizes, a 1px press settle and no elevation.
No install — ask an AI agent to copy this component from registry.json.
import { Button, buttonVariants } from "@/components/ui/button";destructive is a tint, not a solid red block. A toolbar with one filled red bar reads as an error state rather than an option.aria-expanded holds the hover fill while a menu the button opens is showing.icon* sizes render no text, so they need an aria-label.The props worth knowing. Everything else passes straight through to the underlying element, including className, which is merged last so it always wins.
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | "default" | Visual role. |
| size | "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | "default" | Geometry. The icon sizes are square hit areas for a lone glyph. |
| asChild | boolean | false | Render the caller's child element instead of a <button>, keeping these styles. |