UIButtonGroup

Create a button with a context menu button component.

Since: 6.4.0

NameTypeDefaultDescription

label

string

Required - The text of the label

enabled

boolean

true

(Deprecated) Use disabled instead

disabled

boolean

false

To disabled button

icon

string

Font awesome class to use as an inline icon prefixed to the button text

type

string

"primary"

Type of button look. See Available types for variations

size

string

Size of button. Variants: large|small

onClick

function

Callback for when the button is clicked

contextIcon

string

Font Awesome class to use as a context icon

onContextClick

function

Optional callback for when context part is clicked

contextIconEnabled

boolean

true

(Deprecated) Use contextIconDisabled instead

contextIconDisabled

boolean

false

If context icon is disabled or not

Example

import {UIButtonGroup} from 'writer'

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

    return el.append(
         $$(UIButtonGroup, {
             contextIcon: 'fa-plus',
             contextIconDisabled: false,
             label: Save,
             disabled: false,
             size: 'small',
             type: 'primary',
             contextClick: (evt) => {
                 // Do something
             },
             onClick: (evt) => {
                 // Do something
             }
         })

type

Available types

The UIButtonGroup.props.type has following variations:

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

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

Name

default

primary

draft

alert

pending

warning

done

schedule

brand

Last updated