FormLabel
Reusable form label component.
Usage
Components are auto-discovered. Use the component directly in any .wrn view:
<FormLabel
for="for"
label="Label"
required="false"
optional="false"
/>Legacy mount name: data-component="FormLabel".
Props and attributes
| Prop | Type | Requirement | Default |
|---|---|---|---|
for | string | Optional | "" |
label | string | Optional | "Label" |
required | boolean | Optional | false |
optional | boolean | Optional | false |
class | string | Optional | "" |
Slots
This component does not declare a slot.
Events
This component does not declare a custom event.
Source contract
Installed source: components/FormLabel.wrn
component FormLabel {
props {
for = ""
label = "Label"
required = false
optional = false
class = ""
}
view {
<label for="{for}" class="wire-label {class}">{label}<span data-show="required" class="wire-required" aria-hidden="true"> *</span>
<span data-show="optional && !required" class="wire-optional"> (optional)</span>
</label>
}
}