Skip to content

EnPopover ​

Preview ​

Props ​

NameDescriptionDefaultControl
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.

RequirementHow EnPopover satisfies it
Keyboard reachableThe default trigger renders as <a href="#">, which is in the tab order natively — no tabindex needed.
Keyboard openableEnter activates the link, which toggles the panel. (With hover activation, the panel opens on focus instead.)
DismissableEsc closes the panel without moving the pointer or focus (WCAG 1.4.13). Clicking outside also closes it.
Advertises that it opens a panelThe trigger carries aria-haspopup="true".
Exposes open statearia-expanded reflects whether the panel is open.
Associates trigger and contentWhile open, the trigger's aria-describedby points at the panel, which is exposed with role="tooltip".

Dos ​

  • Set trigger-label on every icon-only popover, describing the subject of the panel.
  • Keep the title prop and trigger-label distinct — title is the visible panel heading, trigger-label is what a screen reader announces for the trigger.
  • Use EnPopover when 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 icon at its icon-info default. 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-text or sr-only markup inside the toggle slot. Slot content renders inside the trigger link, which already has an aria-label — and aria-label overrides an element's text content, so the hidden span would never be announced. Use trigger-label instead. The sr-text utilities are for hand-written icon-only links, not for these components.
  • Don't add tabindex="0", role="button", or data-trigger attributes to the trigger — the component already provides the equivalent behavior.
  • Don't rely on the default trigger-label value.

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.

PropApplies to EnPopover?
triggerLabelYes — the supported way to set the trigger's accessible name.
disabledYes — prevents the panel from opening.
eventTypeYes — defaults to click. See Hover activation.
openDelay / closeDelayOnly with hover activation. A click-activated popover opens and closes immediately, so these have no effect unless you also set event-type="hover".
isPopoverAlways 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"
MouseClick the trigger to toggleOpens on hover, closes on mouse-out
KeyboardEnter to open, Esc to closeOpens on focus, closes on blur or Esc
openDelay / closeDelayNo effectApplies

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 ​

SlotDescription
defaultThe panel body.
toggleContent 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.