UIButton

Properties

Name Type
props props
state state

new UIButton(props)

Create a simple button, or a button with a context menu button, component. Use addClass() to set "np-ui-secondary" for secondary colors.

Param Type
props props

Example

import {UIButton} from 'writer'

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

    return el.append(
        $$(UIButton, {
            label: this.getLabel('My button'),
            onClick: () => {
                // Do something
            }
        })
    )
}

Example

import {UIButton} from 'writer'

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

    return el.append(
        $$(UIButton, {
            label: this.getLabel('My button')
        })
        .on('click', () => {
            // Do something (substance event callback style)
        })
        .addClass('np-ui-secondary')
    )
}

UIButton.props

Properties

Name Type Description
label string The text of the label
enabled boolean Optional, default true. Set to false to disable button
icon string Font awesome class to use as an inline icon prefixed to the button text
contextIcon string Font Awesome class to use as a context icon
onClick function Callback for when the button is clicked
onContextClick function Optional callback for when context part is clicked

UIButton.state

Properties

Name Type Description
active bool If the context button is active

results matching ""

    No results matching ""