Skip to content

Checkbox

Checkboxes for selecting one or more options. Labels automatically use flex layout when they contain checkboxes.

Control size uses --af-choice-size (default 1.5rem, shared with radio and the switch track height). Override it to scale all choice controls together — see Tokens.

<label>
  <input type="checkbox" class="af-checkbox" checked />
  <span>
    Checked
  </span>
</label>
<label>
  <input type="checkbox" class="af-checkbox" />
  <span>
    Unchecked
  </span>
</label>
<label>
  <input type="checkbox" class="af-checkbox" disabled />
  <span>
    Disabled
  </span>
</label>

Checkboxes also work without classes inside form.af-form:

<form class="af-form">
  <label>
    <input type="checkbox" checked />
    <span>
      Enable notifications
    </span>
  </label>
</form>