---
title: Checkbox
description: A control that allows the user to toggle between checked and not checked.

link:
  doc: https://kobalte.dev/docs/core/components/checkbox
  api: https://kobalte.dev/docs/core/components/checkbox#api-reference
---

<ComponentPreview name="checkbox-demo">

```tsx file=<rootDir>/apps/docs/src/registry/examples/checkbox-demo.tsx

```

</ComponentPreview>

## Installation

<ComponentInstallation>

<Step>

<StepItem>Copy and paste the following code into your project:</StepItem>

  <ComponentSourceTabs>

    ```tsx title="components/ui/checkbox" file=<rootDir>/apps/docs/src/registry/ui/checkbox.tsx

    ```

    ```tsx title="components/ui/checkbox" file=<rootDir>/apps/unocss-playground/src/registry/ui/checkbox.tsx

    ```

  </ComponentSourceTabs>

</Step>

</ComponentInstallation>

## Usage

```tsx
import {
  Checkbox,
  CheckboxControl,
  CheckboxDescription,
  CheckboxInput,
  CheckboxLabel,
} from "@/components/ui/checkbox"
```

```tsx
<Checkbox>
  <CheckboxInput />
  <CheckboxControl>
    <CheckboxLabel />
    <CheckboxDescription />
  </CheckboxControl>
</Checkbox>
```

## Examples

### Disabled

<ComponentPreview name="checkbox-disabled-demo">

```tsx file=<rootDir>/apps/docs/src/registry/examples/checkbox-disabled-demo.tsx

```

</ComponentPreview>

## Changelog

#### 2025-11-13 Form libraries integration

Separate `<Checkbox.Input />` from `<CheckboxControl />` for better flexibility and customization.
