Checkbox

Updated at:

Introduction

A checkbox is a common form component used to select multiple items from a group of options.

image

Configuration items

Category

Configuration

Example

Description

Content

Option list

Configure options manually or by mapping. To configure manually, set each `currentItem` directly. To configure by mapping, set a data source array. Each `currentItem` includes `label`, `value`, and `disabled` properties.

Default value

The default selected option.

Label

The form label. For more information, see Common form properties.

Interaction

Hide

Hides the component. For more information, see Common properties.

Disable

Disables the component.

Validation

Form validation. For more information, see Common form properties.

Style

Margin

The margin. For more information, see Common properties.

Group layout

The group layout. `Single column` displays only one option per row. The default behavior is to wrap options to the next line.

CSS style

Selected color

The color of the selected option.

Hover color

The color of the selected option on hover.

Text color

The color of the text.

Label font size

The font size of the label.

Properties and methods

Name

Type

Example

Description

value

string

checkboxGroup.value

The selected option of the component.

labelText

string

checkboxGroup.labelText

The label text of the component.

disabled

boolean

checkboxGroup.disabled

Indicates whether the component is disabled.

data

array

checkboxGroup.data

The data of the checkbox component.

validationStatus

boolean

checkboxGroup.validationStatus

The validation status of the component.

validationMessage

string

checkboxGroup.validationMessage

The validation message of the component.

blur

func

checkboxGroup.blur()

The component loses focus.

focus

func

checkboxGroup.focus()

The component gains focus.

validate

func

checkboxGroup.validate()

Validates the component.

setValue

func

checkboxGroup.setValue('')

Sets the content of the component.

setDisabled

func

checkboxGroup.setDisabled(true)

Sets the disabled state of the component.

clearValue

func

checkboxGroup.clearValue()

Clears the `value` of the component.

clearValidate

func

checkboxGroup.clearValidate()

Clears the validation information of the component.

clearDisabled

func

checkboxGroup.clearDisabled()

Clears the disabled state of the component.

Event callbacks

Property

Description

The event that is triggered when the value of the input box changes.