Performance
PassFrame rate: 60 fps average, p5 59.9 · Long tasks: 0 tasks, 0 ms total, longest 0 ms · Source gzip 1.7 KB · Runtime 2.8 KB
selfish-mule-85MITToggleUiverse.io
A toggle built with plain HTML and CSS by JkHuger. 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: 60 fps average, p5 59.9 · Long tasks: 0 tasks, 0 ms total, longest 0 ms · Source gzip 1.7 KB · Runtime 2.8 KB
Issues 0 · Screen reader: Pass
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.
<input value="is_hot" name="temperature" type="checkbox" class="ch">/* From Uiverse.io by JkHuger - Tags: switch */
.ch, .ch:before, .ch:after {
transition: all 0.3s ease-in-out;
}
.ch {
background-color: rgb(27,123,145);
border-radius: 0.2em;
box-shadow: 0 0.05em 0 0.05em rgba(0,0,0,0.3) inset;
font-size: 20px;
overflow: hidden;
position: relative;
width: 3em;
height: 1.5em;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
z-index: 0;
}
.ch:before, .ch:after {
content: "";
display: block;
position: absolute;
}
.ch:before {
background-color: currentColor;
border-radius: 0.125em;
box-shadow: 0 0 0 0.05em inset,
-0.12em -0.12em 0 rgb(109,148,184) inset,
-0.4em -0.3em 0 0.05em inset,
0.12em 0.12em 0 rgb(255,255,255) inset;
color: rgb(149,188,224);
opacity: 0.9;
bottom: 0;
left: 0.125em;
width: 1.25em;
height: 1.25em;
z-index: 2;
}
.ch:after {
background-image: /* white */radial-gradient(0.2em 0.5em at 38% 95%, rgb(255,255,255) 49%, rgba(255,255,255,0) 50%),
radial-gradient(0.3em 0.8em at 52% 95%, rgb(255,255,255) 49%, rgba(255,255,255,0) 50%),
radial-gradient(0.25em 0.4em at 67% 95%, rgb(255,255,255) 49%, rgba(255,255,255,0) 50%),
/* yellow */
radial-gradient(0.25em 0.7em at 36% 95%, rgb(255,224,0) 49%, rgba(255,224,0,0) 50%),
radial-gradient(0.4em 1.2em at 52% 95%, rgb(255,224,0) 49%, rgba(255,224,0,0) 50%),
radial-gradient(0.25em 0.6em at 70% 93%, rgb(255,224,0) 49%, rgba(255,224,0,0) 50%),
/* orange */
radial-gradient(0.3em 0.8em at 32% 81%, rgb(255,144,0) 49%, rgba(255,144,0,0) 50%),
radial-gradient(0.5em 1.6em at 52% 95%, rgb(255,144,0) 49%, rgba(255,144,0,0) 50%),
radial-gradient(0.3em 0.9em at 74% 86%, rgb(255,144,0) 49%, rgba(255,144,0,0) 50%),
/* red-orange */
radial-gradient(0.4em 1em at 25% 70%, rgb(255,76,0) 49%, rgba(255,76,0,0) 50%),
radial-gradient(0.7em 2.75em at 52% 100%, rgb(255,76,0) 49%, rgba(255,76,0,0) 50%),
radial-gradient(0.4em 1.2em at 79% 75%, rgb(255,76,0) 49%, rgba(255,76,0,0) 50%);
background-position: 100% 1.5em;
background-size: 1.5em 1.5em;
background-repeat: no-repeat;
border-radius: 0 0 0 0.1em / 0 0 0 0;
box-shadow: 0 0 0 0 rgb(169,208,244) inset;
bottom: 0;
left: 0;
width: 1.5em;
height: 1.5em;
z-index: 1;
}
/* Checked */
.ch:checked {
background-color: rgb(92,8,8);
}
.ch:checked:before {
border-radius: 50%;
transform: translate(1.5em,1.5em) rotate(45deg) scale(0.5);
}
.ch:checked:after {
background-position: 100% 0;
box-shadow: 0 -0.15em 0 0 rgb(169,208,244) inset;
width: 3em;
}
/* Other States */
.ch:focus {
/* Usually an anti-A11Y practice but set to remove an annoyance just for this demo */
outline: 0;
}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 teal square-cornered checkbox slides a knob across and warms its colours when checked, a compact switch with a hardware feel.
Temperature, heating or mode toggles in smart-home apps.
Change the rgb(27,123,145) base, the 3em by 1.5em size, the 0.2em radius and the 0.3s transition.
Build a "Hot and cold temperature switch" component in plain HTML, CSS and JavaScript (no framework). A teal square-cornered checkbox slides a knob across and warms its colours when checked, a compact switch with a hardware feel. Use it for: Temperature, heating or mode toggles in smart-home apps. Expose these controls: Change the rgb(27,123,145) base, the 3em by 1.5em size, the 0.2em radius and the 0.3s 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.