# Checkbox

> A control that toggles between checked and unchecked.

_Updated: 2026-06-04_

A control that toggles between checked and unchecked.

## Installation

```bash
railbase ui add checkbox
```

> [!NOTE]
> `railbase ui add` also copies shared primitives — they ship alongside this component automatically.

## Usage

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

const [checked, setChecked] = useState(false);

<div class="flex items-center gap-2">
  <Checkbox id="terms" checked={checked} onCheckedChange={setChecked} />
  <Label for="terms">Accept terms</Label>
</div>
```
