Component
Task List
Published on
Description
A task list displays a checklist of items with completion states. Use for to-do lists, onboarding checklists, or multi-step progress indicators.
Example
Accessibility
- Use
<input type="checkbox">for each task state, wrapped in a label for click-to-toggle support. - A "check all" / "expand all" control needs three states: checked, unchecked, and mixed (indeterminate). HTML checkboxes support the
indeterminateproperty via JavaScript. - Use
<fieldset>and<legend>if the task list represents a group of related controls. - When a task is removed from the list, move focus to the next logical item — never let focus drop to
<body>.
References
- Check-All / Expand-All Controls (opens in new tab) — Adrian Roselli
- Under-Engineered Custom Radio Buttons and Checkboxen (opens in new tab) — Adrian Roselli
Related
- Checkboxes — for the underlying control pattern
Variables
tasks