Skip to main content

label

Description

Optional. Sets a label for the control inside a field

Usage

label?: string;

Example

Wrap a control inside <Field> tag:

<Field label="First name">
<Text value={v1} />
</Field>

Details

  • If the Field wraps one of input-based controls (like Text), Field automatically assigns id to the inner input. But you can set this id manually via the control id property.
  • Wrapping multiple input-based controls: the label connects to the first one
  • Nested Field components: each control is linked to the closest Field
  • If the content inside Field does not contain input-based controls, no label-input association is created

Related article: Setting a label for a control

Related sample: Field