@resonate/menu-button
v3.0.0-0
Published
Actions menu button
Downloads
7
Readme
@resonate/menu-button
Render a menu button
Installation
npm i --save @resonate/menu-button
Usage
const MenuButton = require('@resonate/menu-button')
module.exports = (state, emit) => {
const menuButton = state.cache(MenuButton, 'super-menu-button')
const button = menuButton.render({
id: 'super-button',
orientation: 'left', // popup menu orientation (top, right, left, bottom)
style: 'blank', (default, blank)
iconName: 'dropdown', // button icon
text: 'Click' // optional if icon name present,
hover: false, // disabled activation on mousehover
items: [
{ iconName: 'star', text: 'favorite', actionName: 'favorite' },
{ iconName: 'share', text: 'share', actionName: 'share' },
{ iconName: 'plus', text: 'add to playlist', actionName: 'add' }
],
updateLastAction (actionName) {
const eventName = actionName
emit(eventName, { props })
}
})
return button
}
See also
License
MIT
Author(s)
- Augustin Godiscal [email protected]