Toggle switches made for the web are often solely constructed
to change when clicked or tapped,
animating side-to-side as they toggle.
That's a good start, but some people like to slide toggle
switches.
Javascript is used for creation and for adding the sliding functionality, but
the toggle is purely CSS.