UIIconButton

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

Since: 7.1.0 (6.2.0)

NameTypeDefaultDescription

icon

string

Required - Icon name from style-guide. Example arrow-right-bold (or (Deprecated) FontAwesome 4 icon. Example fa-user)

disabled

boolean

false

Set to true to disable button

size

string

"normal"

Size of buttons: large|normal|small|tiny

onClick

function

Callback for when the button is clicked

type

string

"default"

Type of button look. See Available types for variations

selected

boolean

false

If button should be i selected state

Example

import {UIIconButton} from 'writer'

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

    return el.append(
        $$(UIIconButton, {
            icon: 'pencil',
            onClick: () => {
                // Do something
            }
        })
    )
}

Example

import {UIIconButton} from 'writer'

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

    return el.append(
        $$(UIIconButton, {
            icon: 'bug',
            size: 'small',
            type:'primary',
            onClick: () => {
                // Do something
            }
        })
    )
}

type

Available types

The UIButton.props.type has following variations:

Type dark is used on buttons on dark background

Name

default

primary

negative primary

dark default

dark black