Checkbox

Checkboxes allow users to select one or more items from a predefined list of independent options.

Best practices

Use Checkbox
  • When a user selects one or multiple options from a predefined list
  • For accepting terms of service and similar functionality
  • With clear error messaging in case of validation errors
  • With proper guidelines listed below
Don’t use Checkbox
  • If the button navigates you to a new page, use one of our link components
  • If the option selection affects the state of other checkboxes, use the radio button instead
  • If the selection options are binary, like on/off, consider using toggle switches
  • If there are more than five options, consider using the multi-select dropdown

Variations

Checkbox Variations
#VariationUsage
1Without LabelCheckbox without a label could be used by following and implementing appropriate accessible guidelines and techniques.
2With LabelCheckbox should always have a short, clear and descriptive label that explains its purpose.
3DisabledLimit the use of disabled elements as they are not interactive and cannot be focused by keyboard. Disabled element provide visual indicator, but they don’t need to meet color contrast standards.
4With Error MessageCheckbox shows an error message of a selection is needed to move forward. Havin clear messaging to the user is very important for them to know how to correct the error.
5GroupedCheckbox group is used when a user needs to select one or more options from a set of options, like selecting toppings for pizza.
6Indeterminate GroupCheckbox grouped together where child checkbox is depended on default checkbox. Default checkbox changes to selected if all child are selected, indeterminate if some child checkbox is selected.

Recommendations

Labels should be short, clear and descriptive. It should be easy for the user to understand what they are selecting.

Do this
Don’t do this

Avoiding ending labels in punctuation, commas, or semicolons.

Do this
Don’t do this

Wrap long labels below the label so the control and label are top aligned. Avoid wrapping below the control or adding ellipsis.

Do this
Choose pizza toppings
Don’t do this
Choose pizza toppings

Choose checkbox if you want the ability to select multiple options. Use a radio button when a user is required to make only 1 selection.

Do this
Choose pizza toppings
Do this
Choose crust

Checkboxes listed vertically are easier to consume then those listed horizontally. If you use horizontal layout, limit the number of options to three across.

Do this
Choose pizza toppings
Don’t do this
Choose pizza toppings

For vertical layout limit the vertical options to five. Consider using multi select dropdown when there are many options to select from.

Do this
Multiple options can be selected.
Don’t do this
What benefits apply to you?

Checkbox conveys selection of one or multiple items. If boolean (on/off) state is required consider using toggle switch.

Do this
Don’t do this

Avoid adding error per item, instead add it to the group.

Do this
Checkbox Group Label
Don’t do this
Checkbox Group Label

Responsive

When the label is too long for horizontal space, it wraps to another line below the text.

On smaller breakpoint the horizontal list will reflow into vertical list to fit the viewport. Minimum screen size to design for is 320px.

Hobbies

Questions?

Connect with the DLS Team on Slack or by email.

Resources

Check out additional resources.