Checkbox

An accessible checkbox with a soft animated checkmark. Pairs with a label and supports controlled and uncontrolled usage.

Installation

npm install @bloomkit/react

Usage

import { Checkbox } from "@bloomkit/react";
 
<Checkbox label="Accept terms" />

Controlled

const [checked, setChecked] = useState(false);
 
<Checkbox
  label="Remember me"
  checked={checked}
  onCheckedChange={(v) => setChecked(v === true)}
/>

Default checked

<Checkbox label="Subscribe to updates" defaultChecked />

Without label

<Checkbox aria-label="Select item" />

Disabled

<Checkbox label="Unavailable option" disabled />

Props

PropTypeDefaultDescription
labelstringText label rendered beside the checkbox
checkedbooleanControlled checked state
defaultCheckedbooleanfalseInitial checked state (uncontrolled)
onCheckedChange(checked: boolean | 'indeterminate') => voidCalled when the checked state changes
disabledbooleanfalsePrevents interaction and dims the checkbox
classNamestring""Additional Tailwind classes