性能
通过帧率: 平均 60 fps,p5 59.9 · 长任务: 0 个,共 0 毫秒,最长 0 毫秒 · 源码 gzip 1.7 KB · 运行时 2.7 KB
sharp-cheetah-12MIT开关Uiverse.io
vikramsinghnegi 用纯 HTML 和 CSS 做的开关。按 MIT 许可从 Uiverse.io 收录,此处为实时预览。
质量报告
等级和分数来自构建或测试时跑过的自动检查。没跑过的项目会标成「未检测」,不会填假数据。
帧率: 平均 60 fps,p5 59.9 · 长任务: 0 个,共 0 毫秒,最长 0 毫秒 · 源码 gzip 1.7 KB · 运行时 2.7 KB
问题 0 · 读屏: 通过
没有持续动效
无溢出
帧率和长任务是在无界面的 Chromium 里用软件 WebGL 测的,只适合在本站组件之间比较,不代表真机表现。
不适用:静止时没有可见动画;由悬停触发的动画没有测试。
没有 axe-core 违规。

检测于 2026年11月15日 · 数据来自自动脚本,不是手工填写。
按实际尺寸显示。
复制内容以许可声明开头,使用代码时请保留。
<div class="switch demo3">
<input type="checkbox" />
<label><i></i></label>
</div>/* From Uiverse.io by vikramsinghnegi - Tags: material design, animation, gradient, switch, on, off, toggle, figma */
.switch {
position: relative;
margin: 25px 20px;
}
.switch input {
top: 0;
right: 0;
bottom: 0;
left: 0;
opacity: 0;
z-index: 100;
position: absolute;
width: 100%;
height: 100%;
cursor: pointer;
}
.switch.demo3 {
width: 180px;
height: 50px;
}
.switch.demo3 label {
display: block;
width: 100%;
height: 100%;
background: #d8ba5f;
border-radius: 50px;
box-shadow: inset 0 4px 8px 2px rgba(248, 6, 6, 0.2),
0 1px 0 rgba(255, 255, 255, 0.5);
}
.switch.demo3 label:after {
content: "";
position: absolute;
z-index: -1;
top: -8px;
right: -8px;
bottom: -8px;
left: -8px;
border-radius: inherit;
background: #ababab;
background: -webkit-gradient(linear, 0 0, 0 100%, from(#f2f2f2), to(#ababab));
background: -webkit-linear-gradient(#f2f2f2, #ababab);
background: linear-gradient(#f2f2f2, #ababab);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3), 0 1px 1px rgba(0, 0, 0, 0.25);
}
.switch.demo3 label:before {
content: "";
position: absolute;
z-index: -1;
top: -18px;
right: -18px;
bottom: -18px;
left: -18px;
border-radius: inherit;
background: #eee;
background: linear-gradient(#e5e7e6, #eee);
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
filter: blur(1px);
}
.switch.demo3 label i {
display: block;
height: 100%;
width: 60%;
border-radius: inherit;
background: silver;
position: absolute;
z-index: 2;
right: 40%;
top: 0;
background: #b2ac9e;
background: linear-gradient(#f7f2f6, #b2ac9e);
box-shadow: inset 0 1px 0 white, 0 0 8px rgba(0, 0, 0, 0.3),
0 5px 5px rgba(0, 0, 0, 0.2);
}
.switch.demo3 label i:after {
content: "";
position: absolute;
left: 15%;
top: 25%;
width: 70%;
height: 50%;
background: #d2cbc3;
background: linear-gradient(#cbc7bc, #d2cbc3);
border-radius: inherit;
}
.switch.demo3 label i:before {
content: "off";
text-transform: uppercase;
font-style: normal;
font-weight: bold;
color: rgba(0, 0, 0, 0.4);
text-shadow: 0 1px 0 #bcb8ae, 0 -1px 0 #97958e;
font-family: Helvetica, Arial, sans-serif;
font-size: 24px;
position: absolute;
top: 50%;
margin-top: -12px;
right: -50%;
}
.switch.demo3 input:checked ~ label {
background: #9abb82;
}
.switch.demo3 input:checked ~ label i {
right: -1%;
}
.switch.demo3 input:checked ~ label i:before {
content: "on";
right: 115%;
color: #82a06a;
text-shadow: 0 1px 0 #afcb9b, 0 -1px 0 #111311;
}控件 · HTML · CSS · JS
直接改代码,再用控件微调,预览会随输入实时更新。

在线编辑每个组件,用控件微调,下载完整源码,复制进阶提示词。
一次性 $49占位价格
测试模式:不会真实扣款。
免费:预览、复制按钮和课程说明。
180px 宽的芥末色轨道带偏红的内阴影和外圈光环,里面一颗大滑钮,厚实又好点。
自助终端、触摸屏和大尺寸设置控件。
改 #d8ba5f 轨道、rgba(248,6,6,0.2) 内阴影、180px × 50px 尺寸和 -8px 光环。
用纯 HTML、CSS 和 JavaScript(不用框架)做一个「宽芥末色胶囊开关」组件。180px 宽的芥末色轨道带偏红的内阴影和外圈光环,里面一颗大滑钮,厚实又好点。 适用场景:自助终端、触摸屏和大尺寸设置控件。 开放这些可调项:改 #d8ba5f 轨道、rgba(248,6,6,0.2) 内阴影、180px × 50px 尺寸和 -8px 光环。 支持浅色和深色主题,遵守 prefers-reduced-motion 并给出静止画面,保证文字清晰、控件可用键盘操作。请写原创代码,不要从付费或受限的组件库复制。
更完整的提示词,包含调参、无障碍和接入步骤。