Checkbox
- Switch
- Switch reflects a boolean state (enabled/disabled, on/off)
- Switch has a more approachable UI that users may associate with an immediate response
- Checkbox
- A single Checkbox should be used when agreeing/acknowledging/accepting terms/policies, etc.
- Typically associated with a form that must be submitted for changes to be saved/reflected
- Checkbox is used when multiple items can be selected
- Only used to change settings, not as a trigger
- Use Button if you need to perform an action
- Radio
- Use Radio if you need to toggle between two non-binary options (e.g. CSV/PDF, %/$)
- Typically associated with a form that must be submitted for changes to be saved/reflected
- Radio is used when the options are mutually exclusive
- Only used to change settings, not as a trigger
- Use Button if you need to perform an action
A CheckboxGroup
implementation using Formik and Yup to require at least one box be selected. Child content is treated as helper text.
A checkbox can have an indeterminate state when its value cannot be expressed with a binary true
or false
value. This state is most often used on groups of checkboxes that contain “children” elements, which can have different values.
Disabled states should be used with caution.
It may sometimes be necessary to hide labels, but label text must still be made available for screen readers. This example uses the visuallyHideLabel
prop to visually hide the label.
Name | Type | Default | Description |
---|---|---|---|
children |