1. Docs
  2. components
  3. Checkbox

Checkbox

A control that allows the user to toggle between checked and not checked.

Installation

Copy and paste the following code into your project.

Update the import paths to match your project setup.

Usage

Single import

import { Checkbox } from "~/components/ui/checkbox";
<Checkbox.Provider>
  <Checkbox.Root>
    <Checkbox.Indicator />
  </Checkbox.Root>
</Checkbox.Provider>

Multiple imports

import {
  CheckboxProvider,
  CheckboxRoot,
  CheckboxIndicator,
} from "~/components/ui/checkbox";
<CheckboxProvider>
  <CheckboxRoot>
    <CheckboxIndicator />
  </CheckboxRoot>
</CheckboxProvider>

Examples

Default

Disabled

Form