# Chip

> Pill chip, optionally dismissible.

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

## Install

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

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

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

## Import

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

```tsx
import { Chip } from "@/components/ui/chip"
```

## Usage

```tsx
import { Chip } from "@/components/ui/chip"

export function Example() {
  return (
    <>
      <Chip>Default</Chip>
      <Chip onDismiss={() => undefined}>Dismissible</Chip>
    </>
  )
}
```

## API

### Chip

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | "primary" \| "secondary" \| "success" \| "warning" \| "destructive" \| "outline" \| "soft" | "primary" |  |
| `onDismiss` | () => void | — | Shows a remove button when set. |
| `dismissLabel` | string | "Remove" |  |

## See also

- [HTML page](https://ui.anuragroy.dev/component/chip): Preview and the same docs in the site chrome.
- [Registry item](https://ui.anuragroy.dev/r/chip.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.
