EnPopover
Preview
Props
| Name | Description | Default | Control |
|---|---|---|---|
| tooltipText | Text that shows in the popup string | "Tooltip is empty" | |
| padding | The minimum distance in px that the popup will position from the edges of the window. number | 15 | |
| placement | Position of popup from the toggle. Popup will auto adjust if it does not have enough room to fully display. string | "top" | |
| superscript | Applies superscript to the tooltip toggle element. boolean | false | |
| icon | Icon or CSS class for the toggle. string | "icon-info" | |
| linkOnClick | URL link if the tooltip is clicked, only works with eventType 'click'. string | "" | |
| toggleFontSize | Changes font size for the toggle only. string | "15px" | |
| dataId | Unique ID used to copy inner html from another source string | unknown | |
| triggerLabel | Accessible name for the default icon-only trigger. Set this to describe what the tooltip or popover explains, e.g. "More information about premiums". string | "Toggle Tooltip" | |
| title | Sets title of the popup. string | "Info" | |
| width | Fixed width of the popup. string | number | 400 | |
| maxWidth | Maximum width the popup can grow to. string | number | 400 |
Slots
toggle
No description
default
No description
Events
No events defined.
Methods
No methods defined.
Accessibility
EnPopover is a click-activated help affordance. Its default trigger is an icon-only link, which means a screen reader has no text to announce unless you give it one — so always set trigger-label. Everything else a keyboard and screen-reader user needs is handled by the component.
Naming the trigger
trigger-label sets the trigger's accessible name. Describe what the panel explains, not the interaction — "About pending changes", not "Open popover" or "Info".
The prop defaults to "Toggle Tooltip". That satisfies "the trigger has a name" but tells a user nothing about what this particular panel contains, so treat it as a placeholder rather than an acceptable value.
trigger-label is inherited from EnTooltip and so does not appear in the props table above — see Inherited props.
What the component handles for you
You do not need to add tabindex, role, or trigger-event attributes to make the popover keyboard operable.
| Requirement | How EnPopover satisfies it |
|---|---|
| Keyboard reachable | The default trigger renders as <a href="#">, which is in the tab order natively — no tabindex needed. |
| Keyboard openable | Enter activates the link, which toggles the panel. (With hover activation, the panel opens on focus instead.) |
| Dismissable | Esc closes the panel without moving the pointer or focus (WCAG 1.4.13). Clicking outside also closes it. |
| Advertises that it opens a panel | The trigger carries aria-haspopup="true". |
| Exposes open state | aria-expanded reflects whether the panel is open. |
| Associates trigger and content | While open, the trigger's aria-describedby points at the panel, which is exposed with role="tooltip". |
Dos
- Set
trigger-labelon every icon-only popover, describing the subject of the panel. - Keep the
titleprop andtrigger-labeldistinct —titleis the visible panel heading,trigger-labelis what a screen reader announces for the trigger. - Use
EnPopoverwhen the help content is rich or more than a sentence or two, and EnTooltip when a short line of text is enough. Activation is a separate choice from styling — a popover can open on hover too, see Hover activation. - Leave
iconat itsicon-infodefault. Content behind a popover is supplementary by definition, so if it seems to warrant a louder glyph that's a sign it should be surfaced instead of hidden — see Choosing the trigger glyph.
Don'ts
- Don't put
sr-textorsr-onlymarkup inside thetoggleslot. Slot content renders inside the trigger link, which already has anaria-label— andaria-labeloverrides an element's text content, so the hidden span would never be announced. Usetrigger-labelinstead. Thesr-textutilities are for hand-written icon-only links, not for these components. - Don't add
tabindex="0",role="button", ordata-triggerattributes to the trigger — the component already provides the equivalent behavior. - Don't rely on the default
trigger-labelvalue.
Inherited props
EnPopover renders an EnTooltip internally, fixed to click activation. Props it does not declare itself are passed through, so some of EnTooltip's props apply here even though the props table above doesn't list them.
| Prop | Applies to EnPopover? |
|---|---|
triggerLabel | Yes — the supported way to set the trigger's accessible name. |
disabled | Yes — prevents the panel from opening. |
eventType | Yes — defaults to click. See Hover activation. |
openDelay / closeDelay | Only with hover activation. A click-activated popover opens and closes immediately, so these have no effect unless you also set event-type="hover". |
isPopover | Always true — it is what gives the popover its panel styling. Don't override it; use EnTooltip if you want tooltip styling. |
Hover activation
EnPopover opens on click by default. Set event-type="hover" when you want the popover's panel styling — the heading bar and the wider, padded body — on an affordance that opens on hover instead:
event-type default (click) | event-type="hover" | |
|---|---|---|
| Mouse | Click the trigger to toggle | Opens on hover, closes on mouse-out |
| Keyboard | Enter to open, Esc to close | Opens on focus, closes on blur or Esc |
openDelay / closeDelay | No effect | Applies |
Both modes stay keyboard accessible and both keep the panel styling, so trigger-label is required either way. Prefer the default click activation when the panel holds more than a sentence or two — a hover panel is harder to reach and read, and it disappears on mouse-out.
Events
EnPopover emits opened and closed when the panel opens and closes, mirroring EnTooltip. (The generated Events table above does not pick these up.)
Slots
| Slot | Description |
|---|---|
default | The panel body. |
toggle | Content rendered inside the default trigger link, for replacing the icon. The trigger stays a focusable link and keeps its aria-label. |
EnTooltip's trigger slot — which replaces the trigger element entirely — is not available through EnPopover.
Related Components
- EnTooltip — hover-activated help text.
- Accessibility utilities —
sr-text/sr-onlyfor hand-written icon-only links.