Label
Name an input, mark it as required, and connect the label to its field.
Usage guide
#Keep an always-visible explanation of the expected value beside the field.
Connect to an input
Set
forto the input element'sid. Clicking the Label focuses the connected input.Arrange to fit the form
Use
valuePositionandwidthfor placement and width, andrequiredPositionfor the required marker.
Examples
#Feature examples
#Choose a feature from 6 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.
No matching features.
API reference
#Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.
<sy-label>
Properties
| Attribute / Property | Type | Default | Description |
|---|---|---|---|
boolean | false | Style the label as disabled. Also set disabled on the associated input. | |
boolean | false | Add a required marker. Set required on the input component for actual validation. | |
'left' | 'right' | 'right' | Place the required marker on the left or right of the label. | |
string | '' | id of the associated input element. | |
string | '' | Current value or item identifier. | |
'left' | 'right' | 'center' | 'left' | Text alignment within the label area. | |
string | '' | Label area width, as a CSS length. |
Slots
| Slot | Description |
|---|---|
| Component body or child items. |