EnLabelIndicators
The icons that follow a field's label text: an info tooltip, the critical-field warning, and the lock for controls that have no input box to draw one in. EnFormGroup and the option groups render this for you from their tooltip, critical and locked props, so most forms never touch it directly. Use it when you build a label by hand and want it to read like the generated ones.
Preview
Props
| Name | Description | Default | Control |
|---|---|---|---|
| tooltip | Text for an info tooltip. Uses en-components' string | "" | |
| tooltipProps | Extra props for the Record<string, any> | {} | |
| popover | Shows boolean | false | |
| critical | Shows the critical-field warning icon. boolean | false | |
| locked | Shows the lock icon. boolean | false | |
| lockedMessage | Why the field is locked. Shown as a tooltip on the lock icon, which becomes focusable so the text is reachable from the keyboard while the control itself is disabled. string | "" |
Slots
No slots defined.
Events
No events defined.
Methods
No methods defined.
Guidelines
- The asterisk stays on the left; everything else trails. Put the component after the label text, inside the label element, so the icons are read as part of it.
- Nothing to show renders nothing. With every prop empty or false the component renders no element at all, so it can be wired unconditionally.
- The tooltip needs en-components. It uses
EnTooltipwhen the app has registered it, and falls back to a titled info icon otherwise. Withpopoverit uses a click-to-openEnPopoverinstead, falling back toEnTooltipand then the titled icon whenEnPopoverisn't registered. ThelockedMessagetooltip uses en-components'v-tooltipthe same way, with a nativetitleas the fallback.
Related
- EnFormGroup — When to mark a field critical or locked, and what each state looks like on the control.
- Forms styleguide — The
is-critical,is-lockedandform-label-indicatorclasses behind it.