A worked example, rendered from real sample data. Sign in to run the tool on your own input.
accent=#10b981.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #d1d5db; border-radius: 999px; cursor: pointer; transition: .2s; }
.switch .slider::before { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.switch input:checked + .slider { background: #10b981; }
.switch input:checked + .slider::before { transform: translateX(20px); }
Build an iOS-style toggle switch — slider moves on :checked. Part of the DevTools Surf developer suite. Browse more tools in the CSS collection.