UIButton

Create a simple button, or a button with a context menu button component.

Properties

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'),
            size: 'small',
            type: 'done'
        })
        .on('click', () => {
            // Do something (substance event callback style)
        })
    )
}

Available types

The UIButton.props.type has following variations:

By adding -secondary to the type you down size it automatically. Good use with a "Cancel"-button

Type -darkMode should be added if button is on dark background

Last updated