Performance
PassFrame rate: 60 fps average, p5 59.9 · Long tasks: 0 tasks, 0 ms total, longest 0 ms · Source gzip 1.4 KB · Runtime 2.4 KB
wise-bobcat-72MITToggleUiverse.io
A toggle built with plain HTML and CSS by Charly-T. 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.4 KB · Runtime 2.4 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.
<div class="switch">
<input type="checkbox">
<div class="left"></div>
<div class="right"></div>
<div class="switcher"></div>
</div>/* From Uiverse.io by Charly-T - Tags: switch */
.switch {
--switch-width: 3.5em;
--switch-height: calc(var(--switch-width) / 2);
--left-ball-color: black;
--right-ball-color: white;
width: var(--switch-width);
height: var(--switch-height);
border-radius: calc(var(--switch-height) / 2);
background-color: var(--left-ball-color);
position: relative;
overflow: hidden;
}
.switch input[type="checkbox"] {
width: 100%;
position: absolute;
height: 100%;
margin: 0;
opacity: 0;
}
.switch .left {
position: absolute;
width: calc(var(--switch-width) / 3);
height: calc(var(--switch-height) / 1.5);
background-color: var(--left-ball-color);
border-radius: 50%;
left: calc((var(--switch-height) - (var(--switch-height) / 1.5)) / 2);
top: calc((var(--switch-height) - (var(--switch-height) / 1.5)) / 2);
z-index: 2;
pointer-events: none;
}
.switch .right {
position: absolute;
width: calc(var(--switch-width) / 3);
height: calc(var(--switch-height) / 1.5);
background-color: var(--right-ball-color);
border-radius: 50%;
right: calc((var(--switch-height) - (var(--switch-height) / 1.5)) / 2);
top: calc((var(--switch-height) - (var(--switch-height) / 1.5)) / 2);
z-index: 2;
pointer-events: none;
}
.switch .switcher {
position: absolute;
width: calc(100% + var(--switch-width) / 3);
height: 100%;
background-color: var(--right-ball-color);
z-index: 1;
left: calc(-50% + var(--switch-width) / (3 * 2));
pointer-events: none;
transition: left 500ms ease;
border-top-left-radius: calc(var(--switch-width) / 3);
border-bottom-left-radius: calc(var(--switch-width) / 3);
}
.switch .switcher:before {
position: absolute;
content: '';
width: calc(var(--switch-width) / 3);
height: 100%;
background-color: var(--left-ball-color);
display: block;
border-bottom-right-radius: 50%;
border-top-right-radius: 50%;
z-index: 2;
}
.switch .switcher:after {
position: absolute;
content: '';
width: calc(var(--switch-width) / 3);
height: 100%;
background-color: var(--right-ball-color);
display: block;
border-bottom-left-radius: 50%;
border-top-left-radius: 50%;
}
.switch input:checked ~ .switcher {
left: 100%;
}
.switch input:checked ~ .switcher:before {
display: none;
}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.
Black and white balls swap places inside a capsule as the switcher slides, a crisp two-tone way to flip a mode.
Theme switches and minimalist monochrome sites.
Set --switch-width (3.5em), --left-ball-color (black) and --right-ball-color (white); the height follows the width.
Build a "Black and white yin-yang switch" component in plain HTML, CSS and JavaScript (no framework). Black and white balls swap places inside a capsule as the switcher slides, a crisp two-tone way to flip a mode. Use it for: Theme switches and minimalist monochrome sites. Expose these controls: Set --switch-width (3.5em), --left-ball-color (black) and --right-ball-color (white); the height follows the width. 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.