Components
Switch
A toggle built from a native checkbox with a switch role.
The switch is a restyled <input type="checkbox" role="switch"> with a track and thumb.
Bind it like any checkbox (checked, name, value).
Default
Loading components…
<fieldset class="field-group"> <legend>Notifications</legend> <div class="flex flex-col gap-xs"> <label class="field" data-orientation="horizontal"> <input type="checkbox" role="switch" name="notifications-email" /> <span class="field__label">Email notifications</span> </label> <label class="field" data-orientation="horizontal"> <input type="checkbox" role="switch" name="notifications-2fa" checked /> <span class="field__label">Two-factor authentication</span> </label> </div></fieldset>