UIIconButtonMenu

Since: 7.1.0

Name

Type

Default

Description

icon

string

Required - Name of the icon

list

object

Required - Menu list object

list.header

string

Header for menu

list.type

string

Alternative plain for none selected presentation

list.horizontalPosition

string

"\"right\""

List position against button

list.items

Array.<object>

Required - Menu items

list.items.text

string

Required - Menu item text

list.items.selected

boolean

false

If menu item is selected

list.items.onClick

function

Required - onClick callback

Example

import {UIIconButtonMenu} from 'writer'

render($$) {
    const el = $$('div')

    return el.append(
        $$(UIIconButtonMenu, {
             icon: 'navigation-menu-horizontal-bold',
             list: {
               items: [
                 { name: 'Menu item 1', selected: true, onClick: () => { ... }},
                 { name: 'Menu item 2', onClick: () => { ... }}
               ]
             }
        })
    )
}

Last updated