Checkbox
Multi-select checkbox group. Controlled via value: (string | number)[] and onChange.
Preview
Preview
Anatomy
import { Checkbox } from '@wire-ui/react'
<Checkbox.Root value={selected} onChange={setSelected}>
<Checkbox.Item value="option-a">
<Checkbox.Indicator>✓</Checkbox.Indicator>
<Checkbox.Label>Option A</Checkbox.Label>
</Checkbox.Item>
</Checkbox.Root>Root props
| Prop | Type | Default | Description |
|---|---|---|---|
value | (string | number)[] | — | Controlled selected values |
defaultValue | (string | number)[] | [] | Initial selected values |
onChange | (value: (string | number)[]) => void | — | Called when selection changes |
disabled | boolean | false | Disables all items |
Item props
| Prop | Type | Description |
|---|---|---|
value | string | number | The value this item represents |
disabled | boolean | Disables this specific item |
Indicator data attributes
| Attribute | Values |
|---|---|
data-state | "checked" / "unchecked" |
data-disabled | Present when disabled |
Last updated on