Skip to content

The Checkbox Component

The main function of the Checkbox component is to toggle a boolean value.

TriggerComponent

例子

ts
if (_.xCheckbox(state, "Check me", disabled)) {
  alert(_.$ev ? "Checked!" : "Unchecked!");
}

Param: state

type: D<boolean>

D<boolean|undefined> if indeterminate state is supported

The state of the checkbox.

Param: label

optional

type: D<Content>

The label of the checkbox.

Param: disabled

optional
= false

type: D<boolean>

Whether the checkbox is disabled.

Triggered when: change

data type: boolean

boolean|undefined if indeterminate state is supported

When the state of the checkbox is changed, the new state will be emitted.