# Close Button

> Icon close control for overlays and chips.

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

## Install

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

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

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

## Import

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

```tsx
import { CloseButton } from "@/components/ui/close-button"
```

## Usage

```tsx
import { CloseButton } from "@/components/ui/close-button"

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

## API

### CloseButton

A `Button` that renders an X icon. Accepts all Button props except `children`.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `label` | string | "Close" | Accessible name (`aria-label`). |
| `variant` | Button variant | "ghost" |  |
| `size` | Button size | "icon-sm" |  |

## See also

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