UNPKG

ldx-widgets

Version:

widgets

45 lines (39 loc) 1.23 kB
(function() { var IOSToggleSwitch, React, div, input, label, ref, span; React = require('react'); ref = React.DOM, div = ref.div, input = ref.input, label = ref.label, span = ref.span; IOSToggleSwitch = React.createClass({ displayName: 'IOSToggleSwitch', render: function() { var checked, handleChange, ref1; ref1 = this.props, checked = ref1.checked, handleChange = ref1.handleChange; return div({ key: 'ios-toggle-switch', className: 'ios-toggle-switch', onClick: handleChange }, [ input({ key: 'input-switch', type: 'checkbox', name: 'ios-toggle-switch', checked: checked, className: 'ios-toggle-switch-checkbox', onChange: handleChange }), label({ key: 'switch-label', className: 'ios-toggle-switch-label', htmlFor: 'myios-toggle-switch' }, [ span({ key: 'switch-inner', className: 'ios-toggle-switch-inner' }), span({ key: 'switch-switch', className: 'ios-toggle-switch-switch' }) ]) ]); } }); module.exports = IOSToggleSwitch; }).call(this);