Checkbox
Data Entry
@rockshin/tao-uiSelects one or more independent boolean options.
When to use
Use Checkbox for independent choices, or CheckboxGroup when users can select multiple options from a set.
Recommended
- Use clear labels that describe the checked state.
- Group related options with CheckboxGroup.
Avoid
- Do not use CheckboxGroup when only one option may be selected; use RadioGroup instead.
Examples
Basic usage
Standalone states
Vertical groups
Controlled checkbox
onChange provides a native event; read the next value from target.checked.
Select all and indeterminate
Derive indeterminate state from the selected count instead of storing separate conflicting state.
Vertical options and disabled items
Object options allow individual disabled items; direction controls layout.
Native form values
Write controlled selections into hidden inputs and read them with FormData.
Sizes and shared disabled state
A local Provider can set size or disable a group of controls.