Browse documentation

Component

Checkbox

Use checked and onChange for controlled state, or defaultChecked for native uncontrolled state. indeterminate sets the mixed visual and DOM state.

Preview

Installation

Packages are unreleased. Follow the packed artifact setup for package mode, or run the local CLI in copy mode and complete the reported npm, token CSS, and Tailwind setup.

Copy Checkbox · bash
pnpm exec ui add checkbox
Full installation guide

Usage

This example uses package mode. In copy mode, import the generated component from your project and complete the manual setup steps in the installation guide.

Checkbox example · tsx
import { Checkbox } from '@nimjs/ui';

export function Example() {
  return (
    <label><Checkbox defaultChecked /> Email updates</label>
  );
}

System metadata

API and states

Use checked and onChange for controlled state, or defaultChecked for native uncontrolled state. indeterminate sets the mixed visual and DOM state.

Accessibility

The native checkbox responds to Space and exposes disabled, required, and checked states.