Performance
PassFrame rate: 59.3 fps average, p5 59.9 · Long tasks: 0 tasks, 0 ms total, longest 0 ms · Source gzip 1.2 KB · Runtime 1.3 KB
new-dog-15MITToggleUiverse.io
A toggle built with plain HTML and CSS by PriyanshuGupta28. Collected from Uiverse.io under the MIT licence and shown here live.
Quality report
The grade and score come from automated checks run at build or test time. If a check did not run, it is marked Not tested — numbers are never invented.
Frame rate: 59.3 fps average, p5 59.9 · Long tasks: 0 tasks, 0 ms total, longest 0 ms · Source gzip 1.2 KB · Runtime 1.3 KB
Issues 0 · Screen reader: Needs attention
No continuous motion
No overflow
Frame rate and long-task figures were measured in headless Chromium with software WebGL. They are only comparable between components on this site, and do not represent real devices.
Not applicable: no visible animation at rest. Hover-triggered animation was not tested.
No axe-core violations.

Checked Nov 15, 2026 · Figures come from an automated script, not from hand-written samples.
Shown at real size.
The copy starts with the licence notice. Keep it when you use the code.
<div class="toggle">
<input id="toggle-switch" type="checkbox">
<label for="toggle-switch"></label>
</div>/* From Uiverse.io by PriyanshuGupta28 - Tags: switch, theme-switch, advanced */
.toggle {
position: relative;
width: 60px;
height: 34px;
}
.toggle input[type="checkbox"] {
display: none;
}
.toggle label {
position: absolute;
top: 0;
left: 0;
width: 60px;
height: 34px;
background-color: #ccc;
border-radius: 17px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.toggle label::before {
content: "";
position: absolute;
top: 3px;
left: 3px;
width: 28px;
height: 28px;
border-radius: 50%;
background-color: #fff;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
transition: transform 0.3s ease;
}
.toggle input:checked + label {
background-color: #6000df;
}
.toggle input:checked + label::before {
transform: translateX(26px);
}
.toggle label:hover {
background-color: #999;
}
.toggle input:checked + label:hover {
background-color: rgb(99, 33, 138);
}
.toggle input:active + label {
background-color: #6f4ea3;
}
.toggle input:checked:active + label {
background-color: #009b93;
}
.toggle input:focus + label {
box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2);
}Controls · HTML · CSS · JS
Edit the code and tune it with the controls. The preview updates as you type.

This component runs from a bundled build, so its script is read-only here. Edit the HTML and CSS; the full source is in the Code tab.
Edit every component live, tune it with controls, download the full source and copy the advanced prompts.
$49 one-timePlaceholder price
Test mode: no real payment is taken.
Free: preview, copy buttons and the lesson notes.
A 60px by 34px track with a white shadowed knob that slides across in 0.3s, the plain switch people already know how to use.
Settings pages, forms and any app that wants a familiar control.
Change the #ccc off colour, the checked colour, the 28px knob size and the 0.3s transform transition.
Build a "Classic grey to on switch" component in plain HTML, CSS and JavaScript (no framework). A 60px by 34px track with a white shadowed knob that slides across in 0.3s, the plain switch people already know how to use. Use it for: Settings pages, forms and any app that wants a familiar control. Expose these controls: Change the #ccc off colour, the checked colour, the 28px knob size and the 0.3s transform transition. Support light and dark themes, respect prefers-reduced-motion with a still frame, keep text readable and controls keyboard accessible. Write original code; do not copy from paid or restricted component libraries.
A longer prompt with tuning, accessibility and integration steps.