Checkbox
Controlled or uncontrolled checkbox with indeterminate support and asChild.
At a glance
- Resolves the check icon through
SemanticIconsProvider(key:checkmark). - Forwards every
Pressableprop, plusasChildfor custom roots.
Preview
checked and defaultChecked
Controlled mode: pass checked and pair with onChange. Uncontrolled
mode: pass defaultChecked and let the Checkbox track state itself.
Mixing the two — passing both checked and defaultChecked — picks
controlled and ignores defaultChecked (with a warning in dev).
indeterminate
A controlled-only third state for "some but not all children checked".
Render a parent Checkbox with indeterminate={true} when its children
have a mixed selection, and let it flip back to checked /
!checked when the user toggles the parent.
label
Renders a clickable label next to the box. Pressing the label toggles the Checkbox — same target as the box itself, with a wider hit area that's friendlier on touch.
When you need richer label content (a link inside the label, an icon),
pass children instead — the Checkbox treats the children as the
label slot.
Inline label vs Field
The label prop is the inline label (right of the box) — the control's own affordance.
Use it for stand-alone checkboxes:
For grouped settings with description and error, wrap in <Field>:
See Field for the full API. For custom layouts, use the compound API.
disabled
Greys out the box and blocks onChange. Forwarded as
aria-disabled so screen readers announce the state.
onChange
Fires with the next boolean checked value (or false when leaving
indeterminate via toggle). Pair with checked for controlled, omit
for uncontrolled — the Checkbox calls it either way so you can react
to the user's input.
asChild
Renders a supplied element as the interactive root. Useful when wrapping the entire row of label + helper text in a single press target.
Accessibility props
When wrapping Checkbox in <Field>, the following ARIA and accessibility
attributes are injected onto the underlying Pressable automatically:
id— matches thehtmlForof the label; generated byField.aria-labelledby— references theField.Labelelement's ID.aria-describedby— referencesField.Descriptionand/orField.ErrorIDs when present.aria-invalid— set when the enclosingFieldhas a non-nullerror.aria-required— set when the enclosingFieldhasrequired={true}.
On native, the React Native counterparts are forwarded instead:
accessibilityLabelledBy (mirrors aria-labelledby) and
accessibilityDescribedBy (mirrors aria-describedby).
You can also pass any of these props explicitly when using Checkbox outside a
Field, e.g., <Checkbox aria-label="Accept terms" />.
Native preview
Props
| Prop | Type | Default | Description |
|---|---|---|---|
accessibilityDescribedBy | string | — | React Native accessibilityDescribedBy forwarded to the Pressable |
accessibilityLabelledBy | string | — | React Native accessibilityLabelledBy forwarded to the Pressable |
aria-describedby | string | — | aria-describedby forwarded to the Pressable |
aria-invalid | boolean | — | Marks the control as invalid — set by Field.Control when there is an error |
aria-labelledby | string | — | aria-labelledby forwarded to the Pressable |
aria-required | boolean | — | Marks the control as required — set by Field.Control |
asChild | boolean | — | — |
checked | boolean | — | — |
className | string | — | — |
defaultChecked | boolean | false | — |
disabled | boolean | — | — |
id | string | — | DOM id / nativeID forwarded to the Pressable — used by Field.Control |
indeterminate | boolean | — | — |
label | string | — | — |
name | string | — | HTML name attribute (web only) |
onChange | (next: boolean) => void | — | — |
testID | string | — | — |