Checkbox input is a component to build user interface, an instance of Component module.
npm install spa-component-checkbox
Add the singleton to the scope:
var CheckBox = require('spa-component-checkbox');
Create instance with custom config:
var checkBox = new CheckBox({
value: true,
group: 'lang'
});
Name | Type | Default value | Description |
---|---|---|---|
value | Boolean | false | Initial state |
group | String | null | Group name to work synchronously with other checkboxes |
Set the given state. Does nothing in case the value is already as necessary.
Name | Type | Default value | Description |
---|---|---|---|
value | Boolean | false | value new value to set |
{return} | Boolean | false | operation status |
var _checked;
_checked = checkBox.set(true);
console.log('checked = ', _checked) // Output: _checked = true
There is a global var
DEVELOP
which activates additional consistency checks and protection logic not available in release mode.
If you have any problem or suggestion please open an issue here. Pull requests are welcomed with respect to the JavaScript Code Style.
spa-component-checkbox
is released under the MIT License.