Checkbox & Radio
The sunken square and circle, drawn from the tokens.
How to use it
Copy any example below and paste it in- Markup
.checkon the label, the real input inside it (sr-only), then.check-boxas the drawn control.- Radio
- Add
.check-radiofor the round version. - Why not style the input
- The native control cannot take the inset shadow pair consistently across engines. The real input is still there and still what the form submits.
Checkboxes
<div class="flex flex-col gap-3">
<label class="check">
<input type="checkbox" checked>
<span class="check-box" aria-hidden="true"></span>
<span>Email me about product updates</span>
</label>
<label class="check">
<input type="checkbox">
<span class="check-box" aria-hidden="true"></span>
<span>Send a weekly digest</span>
</label>
<label class="check">
<input type="checkbox" disabled>
<span class="check-box" aria-hidden="true"></span>
<span class="text-muted">Beta features (not on this plan)</span>
</label>
</div>
Radio group
A fieldset and legend, so the group has a name.
<fieldset class="flex flex-col gap-3">
<legend class="form-label">Billing period</legend>
<label class="check check-radio">
<input type="radio" name="period" value="monthly" checked>
<span class="check-box" aria-hidden="true"></span>
<span>Monthly — $24 per seat</span>
</label>
<label class="check check-radio">
<input type="radio" name="period" value="yearly">
<span class="check-box" aria-hidden="true"></span>
<span>Yearly — $240 per seat, two months free</span>
</label>
</fieldset>