Zazz Design Framework
Components

Toggle

A two-state button backed by a native checkbox or radio, styled like a button.

A toggle is a <label class="toggle"> wrapping a visually-hidden <input> and the visible content. It looks exactly like a button — same data-variant and data-size options — but the on state reuses the button's active look, driven entirely by the native input's :checked state (no JS). Use a checkbox for an independent on/off control; use a radio (sharing a name) when exactly one of a set may be on.

Give icon-only toggles an accessible name with aria-label on the input.

Variants

Loading components…

API

AttributeValues
data-variantprimary, muted, ghost, destructive (omit = default)
data-sizesm, icon, icon-sm

The toggle's tokens (--toggle-background, --toggle-radius, …) default to the matching --button-* token, so theming the button family re-skins toggles for free. Override a --toggle-* token at :root or inline for a one-off. To join several toggles into one segmented control, see toggle group.

On this page