snippets
switch
--
- The
b.switch()method generates an HTML button designed to be styled as a switch. It's goal is to provide a switch interface with basic functionality. It's not designed to try to accommodate every use case. -
The specific CSS Styles are the responsibility
of the page. This is the CSS use on this page:
view css
} } } } } } } } } } } -
See the
b.switch()portion of thebitty functionssection in the documentation for more details.
html
--javascript
;
- The
data-r="toggle"receiving element does not get an initial value. It's only updated when a switch occurs. - See the next snippet for a version that initializes the value from localStorage.