Button

Triggers an action or event. Supports multiple variants and sizes, and can render as any element via the asChild prop.

Variants

Six variants cover the full range of visual weight — from the most prominent filled button to a subtle inline link.

Disabled

Add the disabled attribute to prevent interaction.

As Child

Use asChild to render the button as a different element (e.g. a Link) while keeping all button styles and behaviour:

Installation

Props

Extends all standard HTMLButtonElement props.

PropTypeDefaultDescription
variant
"default" | "destructive" | "outline" | "secondary" | "ghost" | "link""default"The visual style of the button.
size
"default" | "sm" | "lg" | "icon""default"The size of the button.
asChild
booleanfalseDelegates all props to the immediate child element via Radix Slot.
disabled
booleanfalsePrevents interaction and applies reduced opacity.
className
stringAdditional Tailwind classes merged via cn().