目录

label

Represents the label for a form component to improve the usability.

Since: 1.0.0

Properties

Name

Type

Default Value

Mandatory

Description

for

string

-

No

ID of the component to bind to.

  • Use this attribute to bind a component by ID, or nest the component under the label. Both methods enable the component to be triggered when the label is tapped.
  • for takes precedence over internal components. If multiple internal components exist, the first one is triggered by default.
  • Currently, the following components can be bound: button, checkbox, radio, and switch.

If an invalid value is passed, the behavior is determined by the actual effect.

Example

<label for="radio1">
  <text>Select radio</text>
  <radio id="radio1"></radio>
</label>