Loading...
Loading...
Créez des interrupteurs à bascule CSS personnalisés avec aperçu en direct
<input type="checkbox" id="toggle" class="toggle-input">
<label for="toggle" class="toggle-label"></label>
<style>
.toggle-input {
appearance: none;
-webkit-appearance: none;
display: none;
}
.toggle-label {
display: inline-block;
width: 50px;
height: 26px;
background: #cbd5e1;
border-radius: 13px;
position: relative;
cursor: pointer;
transition: background 0.3s ease;
}
.toggle-label::before {
content: '';
position: absolute;
width: 20px;
height: 20px;
background: #ffffff;
border-radius: 50%;
top: 3px;
left: 3px;
transition: transform 0.3s ease;
}
.toggle-input:checked + .toggle-label {
background: #6366f1;
}
.toggle-input:checked + .toggle-label::before {
transform: translateX(24px);
}
</style>