# Checkbox

Lets people independently select or clear an option. Use it for binary choices and groups where more than one choice may apply.

Package: `@kela-systems/ui-components` 4.1.0

```tsx
import { Checkbox, CheckboxGroup } from "@kela-systems/ui-components";
```

Links (Kela sign-in needed): [Storybook](https://main--6af1efd9453270bb59a6c00c.chromatic.com/?path=/docs/components-checkbox--docs), [Source](https://github.com/Kela-Systems/kela/tree/main/packages/next/ui-components/src/checkbox), [Figma](https://www.figma.com/design/anhlwrbFM6mUiL0klxeK1I/ARK---Design-System?node-id=46-67)

## Examples

### With a label

Pair the checkbox with a Field, so the label and description are announced.

```tsx
import {
  Checkbox,
  Field,
  FieldContent,
  FieldDescription,
  FieldLabel,
  Stack,
} from "@kela-systems/ui-components";

export default function CheckboxWithLabel() {
  return (
    <Stack gap={4} className="w-full max-w-xs">
      <Field orientation="horizontal">
        <Checkbox id="record-on-alert" defaultChecked />
        <FieldContent>
          <FieldLabel htmlFor="record-on-alert">Record on alert</FieldLabel>
          <FieldDescription>Saves 30 seconds before and after each alert.</FieldDescription>
        </FieldContent>
      </Field>
      <Field orientation="horizontal">
        <Checkbox id="notify-on-arrival" />
        <FieldContent>
          <FieldLabel htmlFor="notify-on-arrival">Notify on arrival</FieldLabel>
        </FieldContent>
      </Field>
      <Field orientation="horizontal">
        <Checkbox id="night-mode" disabled />
        <FieldContent>
          <FieldLabel htmlFor="night-mode">Thermal overlay</FieldLabel>
          <FieldDescription>This camera has no thermal sensor.</FieldDescription>
        </FieldContent>
      </Field>
    </Stack>
  );
}
```

## Props

A `className` on a part adds layout only: placement, sizing and spacing. Pick a look with a variant.

### Checkbox

Also takes the props of `@base-ui/react/checkbox`.

### CheckboxGroup

Also takes the props of `@base-ui/react/checkbox-group`.
