Button is a component to build user interface, an instance of Component module.
npm install spa-component-button
Add the constructor to the scope:
var Button = require('spa-component-button');
Create instance with custom config:
var btnSimple, btnIcon, btnDetached;
btnSimple = new Button({
$node: document.getElementById('btnSimple'),
value: 'Simple button'
});
btnIcon = new Button({
$node: document.getElementById('btnIcon'),
icon: 'menu'
value: 'Button with icon'
});
btnDetached = new Button({
value: 'Button not added to the page',
className: 'wide'
});
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-button
is released under the MIT License.