A toggle UI element.
$ component install segmentio/toggle
varToggle=require('toggle');vartoggle=newToggle();document.body.appendChild(toggle.el);toggle.value();// falsetoggle.value(true);toggle.value();// truetoggle.toggle();toggle.value();// falseCreate a new toggle with an optional starting value and optional el to use instead of creating one.
The toggle's DOM element.
<divclass="toggle"><labelclass="toggle-on-label"></label><divclass="toggle-switch"><inputclass="toggle-checkbox" type="checkbox"></div><labelclass="toggle-off-label"></label></div>Get or set the value of the toggle.
Set the toggle's internal checkbox's name, so forms can be submitted properly.
Toggle the value of the toggle.
Set the on and off labels's HTML.
Add a class to the toggle's element.
Remove a class from the toggle's element.
MIT

