Repo

Usage

<label class="zui-checkbox">
<input type="checkbox" checked />
Accept terms
</label>

Checkbox List

Use .zui-checkbox-list for vertical grouping.

Interests
<fieldset class="zui-field-set">
<legend class="zui-field-legend">Interests</legend>
<div class="zui-checkbox-list">
  <label class="zui-checkbox">
    <input type="checkbox" checked />
    Music
  </label>
  <label class="zui-checkbox">
    <input type="checkbox" />
    Sports
  </label>
  <label class="zui-checkbox">
    <input type="checkbox" checked />
    Travel
  </label>
  <label class="zui-checkbox">
    <input type="checkbox" />
    Reading
  </label>
</div>
</fieldset>

Disabled

<label class="zui-checkbox">
<input type="checkbox" disabled checked />
Disabled checked
</label>
<label class="zui-checkbox">
<input type="checkbox" disabled />
Disabled unchecked
</label>

Shape

A squircle is a rounded square with smooth corners. The checkbox box is inside the label, so put zui-squircle-all on a parent element. Every ZUI component inside it gets a squircle shape. Browsers without corner-shape support show normal rounded corners. To make squircle the default everywhere, see Squircle.

<div class="zui-squircle-all">
<label class="zui-checkbox">
  <input type="checkbox" checked />
  Squircle checkbox
</label>
</div>

CSS custom properties

Set these on :root, on a wrapper, or on the element. See Component custom properties.

Property Default Description
--zui-checkbox-size 1.25em Width and height of the box
--zui-checkbox-radius var(--radius-sm) Border radius of the box
--zui-checkbox-accent var(--color-accent) Border colour, and fill colour when checked

Theme

Copy this CSS to your project: