RFbkak37y3kIY / component-button

Base button implementation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Button component

build status npm version dependencies status devDependencies status Gitter API

Button is a component to build user interface, an instance of Component module.

Installation

npm install spa-component-button

Usage

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'
});

Development mode

There is a global var DEVELOP which activates additional consistency checks and protection logic not available in release mode.

Contribution

If you have any problem or suggestion please open an issue here. Pull requests are welcomed with respect to the JavaScript Code Style.

License

spa-component-button is released under the MIT License.

About

Base button implementation.

License:Other


Languages

Language:JavaScript 57.0%Language:CSS 43.0%