Command Palette

Search for a command to run...

Button

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

Installation

pnpm dlx shadcn@latest add https://dga-registry.vercel.app/r/button.json

Variants

Each variant shown in its default and disabled state.

VariantDescription
defaultPrimary action button
secondarySecondary action
outlineBordered button
destructiveDangerous actions
destructive-secondarySecondary danger
ghostNo background
linkStyled as a link
blackDark button
on-colorFor colored backgrounds
transparentFully transparent

Sizes

Text buttons in xs, sm, default, and lg sizes.

SizeHeight
xs24px
sm32px
default36px
lg40px
icon-xs24×24px
icon-sm32×32px
icon36×36px
icon-lg40×40px

With Icons

Leading Icon

Icon placed before the label, across all sizes and variants.

Trailing Icon

Icon placed after the label — useful for dropdowns, navigation, expand/collapse.

Icon Only

Dedicated icon sizes: icon-xs (24px), icon-sm (32px), icon (36px), icon-lg (40px).

icon-xs
icon-sm
icon
icon-lg

Loading State

Use a spinning icon with animate-spin and disable the button.

Combined Icons

Both a leading and trailing icon in one button.

Props

PropTypeDefaultDescription
variantstring"default"Visual style variant
sizestring"default"Button size
asChildbooleanfalseMerge props onto child element
disabledbooleanfalseDisabled state
classNamestringAdditional CSS classes