Irozon Design System — design foundations, tokens and components by Irozon AB.
Irozon Design System · v1.0
Components / Switch

A binary setting. Native, quiet, unmistakably Irozon.

.iz-switch is for real on/off settings — Notifications, Auto-save, Dark mode — built on a native checkbox with role="switch". No JavaScript is required for the switch itself to work; checked state is the source of truth, read via :checked, never a JS-managed class. Switch uses the same quiet rounded geometry as Irozon's other controls rather than a fully pill-shaped treatment.

Base class
.iz-switch on a <label> wrapping the input, track and (optional) label text.
State
Native <input type="checkbox" role="switch"> — :checked, :disabled, :focus-visible.
Size
One canonical size for v1 — 40×24px track (8px radius), 16×16px thumb (5px radius), 4px inset.
<label class="iz-switch">
  <input class="iz-switch__input" type="checkbox" role="switch" />
  <span class="iz-switch__track" aria-hidden="true">
    <span class="iz-switch__thumb"></span>
  </span>
  <span class="iz-switch__label">Enable notifications</span>
</label>
States

Off is neutral. On is Green + Ink — nothing else.

Off never uses Green — a neutral semantic surface with a canonical border and a clearly visible thumb. On is a purposeful, functional use of Green: the track becomes Green, the thumb becomes Ink. Never Lime, no gradient, no glow — a real state, not decoration.

Rest — neutral surface, visible thumb
Checked — Green track, Ink thumb
Native disabled — reduced emphasis, still legible
Disabled state applies on either value

Try Tab-ing to any switch above — the focus ring draws on the visible track from the hidden native input's own :focus-visible state, offset 3px so it stays perceptible even when the track itself is already Green.

Motion

Precise and quiet. No spring, no bounce.

The thumb's travel, track color and border animate on --motion-duration-fast with --motion-ease-standard — the same hover-state timing used everywhere else in the system, never transition: all. Reduced motion removes the travel/color easing entirely; the on/off state still changes immediately, just without animating.

Not a theme-toggle replacement

Two valid patterns — pick by context, not by default.

.iz-switch is a binary settings control. It does not replace every existing sun/moon theme-toggle icon button — that stays a valid, compact pattern in its own right.

Theme icon toggle
Compact chrome (a masthead, a toolbar) can stay an icon-only .iz-button — data-icon-only, aria-pressed, sun/moon icons. Already the pattern Irozon Invoice uses for its own theme toggle.
Explicit setting row
A settings page listing "Dark mode" alongside "Notifications", "Auto-save", etc. is exactly .iz-switch — a labeled, binary setting among other labeled, binary settings.
Accessibility

Checked, not assumed.

Native semantics
A real <input type="checkbox" role="switch"> — keyboard support (Space to toggle, Tab to focus) comes free from the browser; no custom key handling.
Full click target
The entire <label> — track and text — is clickable, not just the 40×24px track.
Label optional
__label may be omitted if the consumer supplies an accessible name another way (e.g. aria-label on the input) — a track-only switch stays fully accessible.
Focus-visible
Drawn on the visible track from the hidden input's real focus state — never suppressed, never a fake focus style on a non-focusable element.
Disabled
Native disabled on the input — removed from the tab order and inert for free, cursor communicates it on the whole row via :has().
Reduced motion
Track/thumb transitions drop under prefers-reduced-motion: reduce — the state still changes immediately, just without easing.