node package manager

Introducing npm Enterprise add-ons. Integrate third-party dev tools into npm…


UISwitch module for sioux

Sioux UISwitch

The UISwitch class lets you create On/Off buttons, similar to the iOS one. demo

  • sioux-ui


var UISwitch = require('sioux-ui-switch');
var uiswitch = new UISwitch(document.querySelector('.container'));
// document.querySelector('.container') is the element in which the switch will be appended 
.on('tap', function (event) {
.on('change', function (event, state) {
  console.log('State: ' + state);
  • Boolean
  • the state of the switch

Sets the switch to the passed in state (Boolean).

Fires when the switch changed state (when the CSS transition ends);