Performance
PassFrame rate: 54.4 fps average, p5 59.5 · Long tasks: 0 tasks, 0 ms total, longest 0 ms · Source gzip 1.7 KB · Runtime 3.1 KB
witty-fly-56MITToggleUiverse.io
A toggle built with plain HTML and CSS by csemszepp. 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: 54.4 fps average, p5 59.5 · Long tasks: 0 tasks, 0 ms total, longest 0 ms · Source gzip 1.7 KB · Runtime 3.1 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="container">
<label class="switch">
<input class="togglesw" type="checkbox" checked="">
<div class="indicator left"></div>
<div class="indicator right"></div>
<div class="button"></div>
</label>
</div>/* From Uiverse.io by csemszepp - Source: codepen.io/ykadosh/pen/jOwjmJe - Tags: neumorphism, skeuomorphism, switch, toggle switch */
.container {
display: flex;
align-items: center;
justify-content: center;
--hue: 220deg;
--width: 15rem;
--accent-hue: 22deg;
--duration: 0.6s;
--easing: cubic-bezier(1, 0, 1, 1);
}
.togglesw {
display: none;
}
.switch {
--shadow-offset: calc(var(--width) / 20);
position: relative;
cursor: pointer;
display: flex;
align-items: center;
width: var(--width);
height: calc(var(--width) / 2.5);
border-radius: var(--width);
box-shadow: inset 10px 10px 10px hsl(var(--hue) 20% 80%),
inset -10px -10px 10px hsl(var(--hue) 20% 93%);
}
.indicator {
content: '';
position: absolute;
width: 40%;
height: 60%;
transition: all var(--duration) var(--easing);
box-shadow: inset 0 0 2px hsl(var(--hue) 20% 15% / 60%),
inset 0 0 3px 2px hsl(var(--hue) 20% 15% / 60%),
inset 0 0 5px 2px hsl(var(--hue) 20% 45% / 60%);
}
.indicator.left {
--hue: var(--accent-hue);
overflow: hidden;
left: 10%;
border-radius: 100px 0 0 100px;
background: linear-gradient(180deg, hsl(calc(var(--accent-hue) + 20deg) 95% 80%) 10%, hsl(calc(var(--accent-hue) + 20deg) 100% 60%) 30%, hsl(var(--accent-hue) 90% 50%) 60%, hsl(var(--accent-hue) 90% 60%) 75%, hsl(var(--accent-hue) 90% 50%));
}
.indicator.left::after {
content: '';
position: absolute;
opacity: 0.6;
width: 100%;
height: 100%;
}
.indicator.right {
right: 10%;
border-radius: 0 100px 100px 0;
background-image: linear-gradient(180deg, hsl(var(--hue) 20% 95%), hsl(var(--hue) 20% 65%) 60%, hsl(var(--hue) 20% 70%) 70%, hsl(var(--hue) 20% 65%));
}
.button {
position: absolute;
z-index: 1;
width: 55%;
height: 80%;
left: 5%;
border-radius: 100px;
background-image: linear-gradient(160deg, hsl(var(--hue) 20% 95%) 40%, hsl(var(--hue) 20% 65%) 70%);
transition: all var(--duration) var(--easing);
box-shadow: 2px 2px 3px hsl(var(--hue) 18% 50% / 80%),
2px 2px 6px hsl(var(--hue) 18% 50% / 40%),
10px 20px 10px hsl(var(--hue) 18% 50% / 40%),
20px 30px 30px hsl(var(--hue) 18% 50% / 60%);
}
.button::before,
.button::after {
content: '';
position: absolute;
top: 10%;
width: 41%;
height: 80%;
border-radius: 100%;
}
.button::before {
left: 5%;
box-shadow: inset 1px 1px 2px hsl(var(--hue) 20% 85%);
background-image: linear-gradient(-50deg, hsl(var(--hue) 20% 95%) 20%, hsl(var(--hue) 20% 85%) 80%);
}
.button::after {
right: 5%;
box-shadow: inset 1px 1px 3px hsl(var(--hue) 20% 70%);
background-image: linear-gradient(-50deg, hsl(var(--hue) 20% 95%) 20%, hsl(var(--hue) 20% 75%) 80%);
}
.togglesw:checked ~ .button {
left: 40%;
}
.togglesw:not(:checked) ~ .indicator.left,
.togglesw:checked ~ .indicator.right {
box-shadow: inset 0 0 5px hsl(var(--hue) 20% 15% / 100%),
inset 20px 20px 10px hsl(var(--hue) 20% 15% / 100%),
inset 20px 20px 15px hsl(var(--hue) 20% 45% / 100%);
}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 soft inset track with two indicators and a sliding button, all in one hue, looks pressed into the page.
Light, soft-UI dashboards and smart-home or music app settings.
Change --hue (220deg), --accent-hue, --width (15rem), --duration (0.6s) and the --easing curve.
Build a "Soft-UI capsule switch" component in plain HTML, CSS and JavaScript (no framework). A soft inset track with two indicators and a sliding button, all in one hue, looks pressed into the page. Use it for: Light, soft-UI dashboards and smart-home or music app settings. Expose these controls: Change --hue (220deg), --accent-hue, --width (15rem), --duration (0.6s) and the --easing curve. 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.