UICheckbox

Create a simple checkbox

Properties

Name

Type

Default

Description

id

string

Required - Id of the checkbox

label

string

Required - The text label

checked

boolean

false

Wether the checkbox is checked or not

disabled

boolean

false

Wether the checkbox is disabled or not

onChange

function

Callback for when the checkbox value changes

Example

import {UICheckbox} from 'writer'

render($$) {
    const el = $$('div')
    return el.append(
        $$(UICheckbox, {
            id: 'myCheckbox',
            label: this.getLabel('Checky checkbox'),
            checked: true,
            onChange: (checked) => {
                // Do something
            }
        })
    )
}

Last updated