CSS-only styles for transforming an innocent input of type checkbox
to a beautiful switch
which so many desire to have in their UX. Automatically looks great in RTL
direction.
npm i -S gist:f5d36e4c038f986a3f5ddf18b6ca4266
Import or include in some way the CSS file so it applies globally:
Example (when installed in /node_modules
):
import 'checkbox-switch`
Simply add role='switch'
to your input element to apply the styles:
<input type='checkbox' role='switch'/>
Or with a label:
<label>
<input type='checkbox' role='switch'/>
Toggle Me
</label>