Button

PreviousNext

Displays a button or a component that looks like a button.

Installation

pnpm dlx shadcn@latest add button

Usage

import { Button } from "@/components/ui/button"
<Button.Root variant="primary" appearance="filled">
  Button
</Button.Root>

Examples

Primary Variant

Secondary Variant

Error Variant

Disabled

Sizes

With Icon

Icon Only

Loading

Full Width

Rounded

As Child

Props

Button.Root

This component is based on the <button> element and supports all of its props.

Prop

Type

Default

variant
primary
secondary
error
primary
appearance
filled
bordered
muted
ghost
filled
size
xs
sm
md
lg
icon-xs
icon-sm
icon-md
icon-lg
md
asChild
boolean
false
className
string
-
children
ReactNode
-