DevPlatform
Home
Components
Search
Submit
Earn
Login
Sign Up Free
Electric Switch Radios - Preview | DevPlatform
DevPlatform
Categories
Accordion
Animation
Box Shadow
Button
Card
Footer
Form
Gallery
Hero Section
Inputs
Loader
Marquee
Modal
Modules
Navbar
Progress Bar
Radio Buttons
Search-Bar
Sections
Slider
Tab
Timeline
Toggle
Electric Switch Radios
admin1234
Jan 30, 2026
4
0
Share
Live Preview
Refresh
Live Editor
HTML
CSS
JS
HTML
CSS
JavaScript
1
<div class="switch-group"> <label> <input type="radio" name="power" checked> <div class="switch"> <div class="lever"></div> <div class="label">LOW</div> </div> </label> <label> <input type="radio" name="power"> <div class="switch"> <div class="lever"></div> <div class="label">MED</div> </div> </label> <label> <input type="radio" name="power"> <div class="switch"> <div class="lever"></div> <div class="label">HIGH</div> </div> </label> </div>
1
body{ margin:0; height:100vh; display:flex; justify-content:center; align-items:center; background:#020617; font-family:system-ui,-apple-system,BlinkMacSystemFont,sans-serif; color:#fff; } /* group */ .switch-group{ display:flex; gap:26px; } /* hide native */ .switch-group input{ display:none; } /* switch body */ .switch{ width:90px; height:140px; border-radius:18px; background:linear-gradient(180deg,#0f172a,#020617); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), 0 30px 80px rgba(0,0,0,.6); position:relative; cursor:pointer; transition:.35s; overflow:hidden; } /* label text */ .label{ position:absolute; bottom:14px; width:100%; text-align:center; font-size:14px; opacity:.7; } /* lever */ .lever{ position:absolute; top:18px; left:50%; transform:translateX(-50%); width:28px; height:56px; border-radius:999px; background:#94a3b8; box-shadow:inset 0 -6px 12px rgba(0,0,0,.5); transition:.35s; } /* electric core */ .switch::before{ content:""; position:absolute; inset:-40%; background: radial-gradient(circle at 50% 20%, rgba(0,229,255,.6), transparent 40%), radial-gradient(circle at 50% 80%, rgba(139,92,246,.6), transparent 45%); opacity:0; transition:.35s; } /* sparks */ .switch::after{ content:""; position:absolute; inset:-60%; background: linear-gradient(120deg, transparent 48%, rgba(0,229,255,.8) 50%, transparent 52%), linear-gradient(30deg, transparent 46%, rgba(139,92,246,.8) 48%, transparent 50%); opacity:0; animation:sparkMove 1.6s linear infinite; } /* ON state */ input:checked + .switch{ box-shadow: 0 0 0 2px #00e5ff, 0 0 50px rgba(0,229,255,.9); } input:checked + .switch::before, input:checked + .switch::after{ opacity:1; } input:checked + .switch .lever{ top:54px; background:#e0f2fe; box-shadow: inset 0 -4px 8px rgba(0,0,0,.4), 0 0 25px rgba(0,229,255,.8); } @keyframes sparkMove{ from{transform:translateX(-100%)} to{transform:translateX(100%)} }
1
Comments
0
Want to comment?
Please
login
or
sign up
to post comments.
No comments yet
Be the first to comment on this component!
Comments 0
Want to comment?
Please login or sign up to post comments.
No comments yet
Be the first to comment on this component!