@resonate/button
v2.1.0
Published
Render a button element
Downloads
10
Readme
@resonate/button
Render an HTML button element
Install
$ npm i --save @resonate/button
Usage
const button = require('@resonate/button')
const myButton = button({
style: 'blank',
prefix: 'play-button',
onClick: () => {
// do something
},
title: playing ? 'Pause' : 'Play',
iconName: playing ? 'pause' : 'play'
})
document.body.appendChild(myButton)
Options
prefix
A single class or classlistonClick
Button onclick event handlervalue
Button valuetype
Button type (default is 'button')disabled
Button disabled state (default is false)style
Button style (default, blank)iconName
SVG icon nameiconFill
Class names for svg icon fills (see: @resonate/theme-skins)iconSize
SVG icon size (xs, sm, md, lg)text
Button text
License
MIT
Author(s)
- Augustin Godiscal [email protected]