- This package is available via bower:
bower install ember-switch
- Alternatively, you can just download this package and include dist/ember-switch.min.js, and dist/ember-switch.css in your project
The component takes the following parameters:
- isChecked: (true || false) // (whether switch is on or off)
- isDisabled: (true || false) // (whether switch is enabled or disabled)
- labelOn: (true || false) // (the text shown when switch is ON)
- labelOff: (true || false) // (the text shown when switch is OFF)
- hideText: (true || false) // (will hide the switch text when true)
- labelPosition: ('left' || 'right') // right by default. (will position the switch label on left or right)
EXAMPLE:
var controller = Em.Controller.extend({
switchChecked: true,
switchDisabled: false
});
{{switch-component
labelOn='On'
labelOff='Off'
isCheckedBinding=switchChecked
isDisabledBinding=switchDisabled
labelPosition='left'
}}
You can style this switch by overriding the CSS specified in dist/ember-switch.css