How to use the toggle designer
- Choose the control: switch, checkbox or radio.
- Pick a style: classic, rounded, square, minimal, bold or inset.
- Set the size (the label stays at least 44px tall, so the click area is generous) and the animation duration.
- Choose colors for the on state, the off state or border, and the thumb or check mark.
- Check the off-state contrast and target size.
- Export HTML and CSS, SCSS, Tailwind or React.
How it works
The input itself draws the track or box, and ::before draws the thumb, check mark or radio dot:
.toggle__input { appearance: none; width: 49px; height: 28px; border-radius: 999px; background: #94A3B8; }
.toggle__input::before { content: ''; /* thumb */ }
.toggle__input:checked { background: #4F46E5; }
.toggle__input:checked::before { transform: translate(21px, -50%); }
The whole label is clickable, focus shows a clear outline, and a forced-colors rule keeps the control visible in Windows High Contrast mode.
Worked examples
Example 1: notification settings
Load Switch · iOS style for each setting. Write labels as statements (“Email notifications”), not questions, so “on” and “off” make sense.
Example 2: a terms checkbox
Load Checkbox rounded at 24px. Place the label text after the box and link to the terms in the label. Required checkboxes also need an error message if left unchecked.
Example 3: plan selection
Load Radio classic. The HTML export wraps the options in a fieldset with a legend, so screen readers announce the question before the options.
Tips
- Don’t use color alone for state. The thumb position and check mark do the job here.
- Keep the animation short (100–250ms). It turns off for reduced-motion users.
- Disabled controls should explain why they’re disabled somewhere nearby.
Common mistakes
- Removing the input from the accessibility tree. Hiding the real input with
display: noneand styling a span breaks keyboard and screen-reader support. Style the input itself, as this tool does. - Switches inside forms that need a submit. If a change only applies after pressing Save, use a checkbox instead of a switch.
- No visible focus. Every control needs a focus outline; the export includes one in the “on” color.