HTML + CSSToggles

Toggle with cross and check

The knob rolls a full turn as it crosses the switch, swapping a red cross for a check mark.

Settings

16px
1x

Code

<label class="uv-tc"><input type="checkbox" checked><span><i><svg viewBox="0 0 24 24"><path class="x" d="M7 7l10 10M17 7L7 17"/><path class="v" d="M5 12.5l4.5 4.5L19 7.5"/></svg></i></span></label>

Prompt for AI

Paste it into ChatGPT, Claude or Cursor and it will adapt the block to your project with these settings, even if you don’t use React.

More in Toggles

Where to use it

When a switch controls permission, icons remove any doubt. This toggle with a cross and a check suits cookie preferences (“Analytics cookies”), privacy options like “Public profile” or the email alerts of an online store account. Off, the track is red and the knob shows a cross. On, the knob rolls over, spinning once, and reveals a tick.

Red is a strong signal and can make harmless options look like errors. For something as casual as “Show tips”, a neutral toggle may feel friendlier. The “on” color follows your main color, while the red of the off state stays fixed.