We have created css only switches in atmos, so you do not need to include any additional css or JavaScript files into your project, moreover they also support default browser based validation without any additional configuration.
Copy <label class="cstm-switch">
<input type="checkbox" name="option" value="1" class="cstm-switch-input">
<span class="cstm-switch-indicator "></span>
<span class="cstm-switch-description">Switch </span>
</label>
<label class="cstm-switch">
<input type="checkbox" checked name="option" value="1" class="cstm-switch-input">
<span class="cstm-switch-indicator "></span>
<span class="cstm-switch-description">Switch </span>
</label>
<label class="cstm-switch">
<input type="checkbox" checked name="option" value="1" class="cstm-switch-input">
<span class="cstm-switch-indicator bg-success "></span>
<span class="cstm-switch-description">Switch success</span>
</label>
<label class="cstm-switch">
<input type="checkbox" checked name="option" value="1" class="cstm-switch-input">
<span class="cstm-switch-indicator bg-info "></span>
<span class="cstm-switch-description">Switch info</span>
</label>
<label class="cstm-switch">
<input type="checkbox" checked name="option" value="1" class="cstm-switch-input">
<span class="cstm-switch-indicator bg-warning "></span>
<span class="cstm-switch-description">Switch warning</span>
</label>
<label class="cstm-switch">
<input type="checkbox" checked name="option" value="1" class="cstm-switch-input">
<span class="cstm-switch-indicator bg-danger "></span>
<span class="cstm-switch-description">Switch Danger</span>
</label>
You can use switch as checkbox as well as radio just change the input type to radio for radio buttons
Copy <label class="cstm-switch">
<input type="radio" checked name="option" value="1" class="cstm-switch-input">
<span class="cstm-switch-indicator bg-danger "></span>
<span class="cstm-switch-description">Switch Danger</span>
</label>
Copy <label class="cstm-switch ">
<input type="checkbox" required name="option" value="1"
class="cstm-switch-input ">
<span class="cstm-switch-indicator size-lg "></span>
<span class="cstm-switch-description">Large Switch #1</span>
</label>
<label class="cstm-switch m-l-10 ">
<input type="checkbox" required name="option" value="1"
class="cstm-switch-input ">
<span class="cstm-switch-indicator size-lg "></span>
<span class="cstm-switch-description">Large Switch #2</span>
</label>