Components / UI components / Forms
FormsExperimental alpha
Checkbox
A native checkbox for an explicit choice, including a host-controlled mixed state.
Checkbox preview
Loading example…
Interactions use local sample data.
Usage and props
Use for an independent choice or several choices in a group. Give each checkbox a label through Field or a native label. Use indeterminate for a mixed selection. Own checked and indeterminate separately. Clear or recompute the mixed state when the selection changes.
checkedboolean (optional)- The controlled checked state. Update it when the user changes the selection.
onCheckedChange(checked: boolean) => void (optional)- Receives the next checked value. Use it with checked for a controlled checkbox.
indeterminateboolean (optional)- Shows a mixed selection. It does not change checked or the submitted value.
namestring (optional)- The key used in native form data.
disabledboolean (optional)- Prevents changes and excludes the checkbox from native form submission.
These are the main props for the example. The package's TypeScript declarations include the full API.