Variants and sizes

  • Single (k-check).
  • Group (k-group on the <fieldset>, k-group__legend on the <legend>).
  • Parent and items: the items sit in a nested group (k-group--nested), indented by space-3xl, the box plus its gap.

States

  • Unchecked: an empty box with an outline border.
  • Checked: the box fills with ink and shows a tick. Fill and mark, not hue.
  • Mixed: an ink box with a bar, on a parent whose items are partly checked. Choosing it checks every enabled item.
  • Hover: the pointer turns into a hand.
  • Focus: a 2px focus-ring ring 2px outside the box, for keyboard focus.
  • Disabled: box and label drop to ink at 38% (state-disabled-content), with the reason underneath (k-check__reason): "Ada added this file, so only she can delete it".
  • Error: for a required box, the message goes under it with the error icon, as in TextField.

Do and don’t

Do

  • Word each label as the thing chosen, in the positive: "Remind me about due dates", not "Don't remind me".

  • Name every group with a legend.

  • Make "Select all" act on enabled items only.

  • Say why an item is disabled, right under it.

Don’t

  • Use a checkbox for a setting that applies at once; use Switch.

  • Shrink the target to the 20px box; the label takes the tap too.

What you provide

  • Label and checked state; for a parent, the mixed state worked out from its items.
  • Disabled state with its reason.
  • The group's legend, and a name and value for forms.