# Button

> Pill-shaped button with HeroUI-inspired variants, sizes, and a press scale.

Registry name: `button`. HTML docs: https://ui.anuragroy.dev/component/button.

## Install

```bash
npx shadcn@latest add https://ui.anuragroy.dev/r/button.json
```

If the website is down: `npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/button.json`.

Registry JSON: https://ui.anuragroy.dev/r/button.json (GitHub: https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/button.json).

## Import

Import paths follow the consumer `components.json` aliases. After a default install:

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

## Usage

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

export function Example() {
  return <Button>Primary</Button>
}
```

## Examples

### Variants

```tsx
<Button>Primary</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="outline">Outline</Button>
<Button variant="ghost">Ghost</Button>
<Button variant="destructive">Destructive</Button>
```

## API

### Button

Base UI Button with CVA variants. Also accepts the primitive’s props (`disabled`, `nativeButton`, `render`, …).

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | "primary" \| "secondary" \| "tertiary" \| "outline" \| "ghost" \| "destructive" \| "destructive-soft" \| "link" | "primary" |  |
| `size` | "sm" \| "md" \| "lg" \| "icon" \| "icon-sm" \| "icon-lg" | "md" |  |
| `fullWidth` | boolean | false |  |
| `className` | string | — | Merged onto the button styles. |

## Notes

- `buttonVariants` is exported if you need the same styles on a plain element.
- When placed in a `ButtonGroup`, unset `variant` and `size` inherit from the group.
- Use `render` (Base UI) to compose a custom trigger — do not use `asChild`.

## See also

- [HTML page](https://ui.anuragroy.dev/component/button): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/button.json): Source files and dependencies.
- [Catalog](https://ui.anuragroy.dev/component): All components.
- [llms.txt](https://ui.anuragroy.dev/llms.txt): Agent index for this library.
