Button preview

Button

Primary, secondary, ghost and destructive buttons with icons, sizes and a shimmering loading state

  • Group
    Buttons
  • Origin
    Copied · affectUI · source
  • License
    MIT
  • Added
    Oct 18
npx shadcn@latest add @deank/button

The registry stays private. Install from the repo with a GitHub token — see the README.

Usage

import { Button } from "@/registry/components/button/button";

<Button>Label</Button>

Props

NameTypeDefaultDescription
variant"primary" | "secondary" | "ghost" | "destructive""primary"Dark filled, white with an outline, text only, or red for deleting
size"sm" | "md" | "lg""md"32, 40 or 48px high
loadingbooleanfalseSwaps the left icon for a spinner, shimmers the label, sets aria-busy and ignores clicks
iconReactNodeIcon before the label; without children the button becomes square
iconRightReactNodeIcon after the label
...propsbutton attributesEverything a native button takes, including ref, type and disabled

When to use

- Any action a user triggers: submit a form, send a message, open a dialog - Async actions that take a moment – the loading state keeps the label readable while it works

When not to use

Navigation to another page (use a link styled as a button), or toggles (use tactile-toggle / segmented-control).

Related

Slide to confirm · Click spark · Message actions