# Checkbox

> Accessible checkbox built on Base UI.

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

## Install

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

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

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

## Import

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

```tsx
import { Checkbox } from "@/components/ui/checkbox"
```

## Usage

```tsx
import { Checkbox } from "@/components/ui/checkbox"

export function Example() {
  return (
    <label className="flex items-center gap-2 text-sm">
      <Checkbox defaultChecked /> Accept terms
    </label>
  )
}
```

## API

### Checkbox

Base UI Checkbox. Use `checked` / `defaultChecked` / `onCheckedChange`.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `value` | string | — | Required when used inside CheckboxGroup. |

## See also

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