DevPlatform
Home
Components
Search
Submit
Earn
Login
Sign Up Free
Toggle - 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
Toggle
rohit
Feb 02, 2026
6
0
Share
Live Preview
Refresh
Live Editor
HTML
CSS
JS
HTML
CSS
JavaScript
1
<div class="container"> <input type="checkbox" name="checkbox" id="checkbox" /> <label for="checkbox" class="label"> </label> </div>
1
body{ background: #000; } .container { } .label { height: 60px; width: 120px; background-color: #ffffff; border-radius: 30px; -webkit-box-shadow: inset 0 0 5px 4px rgba(255, 255, 255, 1), inset 0 0 20px 1px rgba(0, 0, 0, 0.488), 10px 20px 30px rgba(0, 0, 0, 0.096), inset 0 0 0 3px rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 5px 4px rgba(255, 255, 255, 1), inset 0 0 20px 1px rgba(0, 0, 0, 0.488), 10px 20px 30px rgba(0, 0, 0, 0.096), inset 0 0 0 3px rgba(0, 0, 0, 0.3); display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-align: center; -ms-flex-align: center; align-items: center; cursor: pointer; position: relative; -webkit-transition: -webkit-transform 0.4s; transition: -webkit-transform 0.4s; transition: transform 0.4s; } .label:hover { -webkit-transform: perspective(100px) rotateX(5deg) rotateY(-5deg); transform: perspective(100px) rotateX(5deg) rotateY(-5deg); } #checkbox:checked ~ .label:hover { -webkit-transform: perspective(100px) rotateX(-5deg) rotateY(5deg); transform: perspective(100px) rotateX(-5deg) rotateY(5deg); } #checkbox { display: none; } #checkbox:checked ~ .label::before { left: 70px; background-color: #000000; background-image: linear-gradient(315deg, #000000 0%, #414141 70%); -webkit-transition: 0.4s; transition: 0.4s; } .label::before { position: absolute; content: ""; height: 40px; width: 40px; border-radius: 50%; background-color: #000000; background-image: linear-gradient( 130deg, #757272 10%, #ffffff 11%, #726f6f 62% ); left: 10px; -webkit-box-shadow: 0 2px 1px rgba(0, 0, 0, 0.3), 10px 10px 10px rgba(0, 0, 0, 0.3); box-shadow: 0 2px 1px rgba(0, 0, 0, 0.3), 10px 10px 10px rgba(0, 0, 0, 0.3); -webkit-transition: 0.4s; transition: 0.4s; }
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!