Four styles of toggle: iOS pill, Material square, icon-on-knob, knurled chunky. Click any to flip. All accessible button elements.
A binary input — on or off — styled as a slider that physically moves between two positions. Often replaces a checkbox in settings panels because the state is immediately clear at a glance (the knob's position) without reading the label. Used universally on settings screens, notification preferences, dark mode controls, feature flags.
A relative-positioned track (the colored capsule), with an absolutely-positioned knob inside. State toggled via a CSS class (.on) that changes the track background color and transitions the knob's transform: translateX to the other end. Implement as a real <button> with role="switch" and aria-checked for accessibility. Variants differ only by knob shape, track color, and decorative details — the underlying mechanic is the same.
Tap any toggle. Each card shows a different style.
Build 4 styles of toggle switch, each in a settings card with 3 toggle-row examples. Common mechanics: each toggle is a real