Menu

Button

Primary actions. 7 variants × 3 sizes × 6 states.

Installation

$ npx uix-ui@latest add button

This copies the file into components/ui/button.tsx in your project. npx shadcn@latest add @uix/button works too.

Usage

button.tsx
import { Button } from "@/components/ui/button";

<Button>Order Darjeeling tea</Button>

Examples

Variants

Sizes

With icons, avatar and count

Loading and disabled

Props

PropTypeDefaultDescription
variantprimary | secondary | soft | outline | ghost | destructive | link"primary"
sizesm | md | lg"md"
leadingIconReact.ReactNode–Icon before the label.
trailingIconReact.ReactNode–Icon after the label.
avatarReact.ReactNode–Avatar before the label (for example <Avatar size="xs" initials="AB" />).
badgeReact.ReactNode–Count pill after the label.
leadingDividerbooleanfalseHairline between the avatar / icon and the label.
trailingDividerbooleanfalseHairline between the label and the badge / icon.
loadingbooleanfalseShows a spinner before the content, dims the label and blocks clicks.
showLabelbooleantrueFalse hides the label visually (it stays the accessible name): an icon-only button.

Everything else is passed to the root element, so className, aria-* and event handlers work as usual.

Dependencies

Installed for you by the CLI.

  • class-variance-authority
  • clsx
  • tailwind-merge
  • lib/utils.ts
esc

↑↓ to navigate · ↵ to select · esc to close