How to use the CSS Toggle Switch Generator
Frequently asked questions
Does it need JavaScript?
No, it is pure HTML and CSS.
Can I have several switches?
Yes, reuse the same class on as many labels as you like.
Is it free?
Yes.
Design accessible on/off toggle switches in pure CSS — size, colours and shape — and copy the HTML and CSS.
Set the width, height, colours for on and off, the knob colour, the gap and the shape, then click the live preview to test it. The code uses a real checkbox with role="switch", so it works with the keyboard, screen readers and forms without any JavaScript.
No, it is pure HTML and CSS.
Yes, reuse the same class on as many labels as you like.
Yes.