Skip to content

EnTooltip ​

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"
eventType
string
"hover"
isPopover

Changes to the popover style

boolean
false
width

Fixed width of the popup

string | number
"auto"
maxWidth

Maximum width the popup can grow to

string | number
150
disabled

Disables the tooltip from opening

boolean
false
openDelay

Delay before opening the tooltip in milliseconds.

number
0
closeDelay

Delay before closing the tooltip in milliseconds.

number
0

Slots ​

trigger

No description

toggle

No description

default

No description

Events ​

opened

Opened event.

closed

Closed event.

Methods ​

NameDescription
toggleTooltip

Toggles the tooltip, opened / closed

openTooltip

Opens the tooltip

closeTooltip

Closes the tooltip

Guidelines ​

Choosing the trigger glyph ​

The icon prop defaults to icon-info, and that default is the right choice for essentially every informational tooltip. Content behind a tooltip is supplementary by definition — the reader has to hover or click to reach it — so anything they must not miss doesn't belong here in the first place.

That makes the glyph a poor place to signal importance. If a tooltip's content feels important enough to want icon-exclamation-circle, treat that as a signal to escalate the pattern, not the icon:

If the content is…Use
Supplementary explanation of a field or valueEnTooltip or EnPopover with the default icon-info
A state the reader should review or act onA visible label or badge in the Warning variant — Beacon documents that variant for pending / needs review status
Critical to the page or the taskAn alert, scoped to the content it describes
Needed every time the field is usedhelp-block beneath the field rather than a tooltip

A state and its explanation are two jobs, not one: let a visible Warning label carry the state, and an icon-info tooltip explain what it means.

Note that the glyph and EnIcon's context prop are independent — context controls color and defaults to primary. A louder glyph tends to drift out of step with it, reintroducing the inconsistency through the color instead.

A tooltip on the element itself ​

EnTooltip renders its own trigger glyph. That is right when the tooltip explains something beside the element, and wrong when the thing to explain is the element: a disabled button, a locked form field, a truncated cell. An anchor inside those is invalid inside a <label>, adds a tab stop per element, and on a button-styled option a click on it toggles the option.

For those, use the v-tooltip directive that ships with en-components. It attaches the bubble to the host element with no trigger of its own, opens on hover and focus, closes on leave, blur and Escape, and adds the bubble to the host's aria-describedby while it is open. The bubble is appended to <body> and positioned with Popper, so an overflow container never clips it.

vue
<button v-tooltip="'Saves the plan as a draft'" class="btn btn-secondary">Save draft</button>
<button v-tooltip:bottom="text">…</button>
<td v-tooltip="{ text, placement: 'right', maxWidth: 200, disabled: isEditable }">…</td>
BindingValue
Valuestring — the text; or { text, placement, maxWidth, disabled }
Argumentplacement — top (default), bottom, left, right; an object's placement wins

The directive registers as v-tooltip when the library is installed with app.use. In a <script setup> component that does not go through the plugin, import vTooltip from @front-end/en-components and the template can use v-tooltip directly.

Disabled controls do not hover

Chrome and Safari dispatch no mouse events on a disabled form control, and it cannot take focus. Put the tooltip on the control's wrapper, and give keyboard users a second route to the text. The form components do both: a lockedMessage goes on the element that carries is-locked and on the lock icon beside the label.

Examples ​

Using toggle slot ​

The bubble renders in place, inside whatever holds the trigger, but it does not pick up that context's text styling: a tooltip in a <th>, a .btn or a heading still reads as plain 14px body text. Wrapped text is left-aligned, and there is no alignment prop. To align or style content differently, put a class on an element inside the slot. Lists, links and <strong> inside the bubble keep their normal en-style look.