# Checkbox

> A labelled, controlled checkbox.

- Category: [Inputs & forms](https://tarve.dev/docs.md#inputs)
- Import: `import { Checkbox } from "@tarve/core";`
- Props type: `CheckboxProps`
- Source: [packages/core/src/controls.ts:16](https://github.com/omarcosr/tarve/blob/main/packages/core/src/controls.ts#L16)

## Usage

```tsx title="Checkbox.tsx"
import { Checkbox } from "@tarve/core";

let accepted = false;

<Checkbox
  label="Accept terms and conditions"
  checked={accepted}
  onCheckedChange={(checked) => {
    accepted = checked;
  }}
/>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `checked` (required) | `boolean` | — |  |
| `label` (required) | `string` | — |  |
| `disabled` | `boolean` | — |  |
| `onCheckedChange` | `(checked: boolean) => void` | — |  |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `children`, `class`, `className`, `highlight`, `id`, `key`, `motionFrom`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`, `style`.

Previous: [Field](https://tarve.dev/docs/components/Field.md) · Next: [Switch](https://tarve.dev/docs/components/Switch.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/Checkbox · Index for agents: https://tarve.dev/llms.txt
