3 checkboxes with following states: unchecked, indeterminate, checked

Definitive guide to indeterminate state of a checkbox

In HTML, the indeterminate state is a special visual state for form elements like checkboxes, radio buttons, and progress bars. For checkboxes, this state represents a condition where the checkbox is neither checked nor unchecked – it’s a third visual state typically displayed as a horizontal line (dash) inside the checkbox instead of a checkmark.

Important: the indeterminate state cannot be triggered by user interaction (such as clicking, hovering, or partial clicks). It is only set programmatically via JavaScript and is purely visual – it doesn’t affect the checkbox’s submitted value.

Common use case

The indeterminate state is most commonly used in hierarchical checkbox lists (parent/child relationships) to indicate that some, but not all, child checkboxes are selected. For example:

  • Parent checkbox: indeterminate state (dash) when some children are checked
  • Parent checkbox: checked state when all children are checked
  • Parent checkbox: unchecked state when no children are checked
Continue reading “Definitive guide to indeterminate state of a checkbox”