Toggletip
Overlay – Disclosure
A toggletip is a small popup that appears when a user clicks a trigger or activates it with the keyboard, showing helpful information or interactive content such as buttons and links. Its read-only counterpart is the tooltip, which appears on hover or focus and holds short supplemental text only. Both are documented here — they look alike and share a trigger, but differ in how they open and what they may contain.
Measured under WLTP conditions. Real-world figures vary with driving style, load and weather.
How we measureReady to use
A toggletip is a small popup that opens when someone clicks a trigger or activates it with the keyboard. It carries helpful information or interactive content — a link, a button, a short block of copy — and stays until it is dismissed. Its read-only counterpart is the tooltip: it appears on hover or focus, holds a few words of supplemental text, and never contains anything you can interact with. The two look alike and share an icon-based trigger, but they differ in how they open and in what they are allowed to contain.
Anatomy
Section titled “Anatomy”- Toggletip
- Arrow
- Container
- Close button
- Title (optional)
- Content
- Link (optional)
The Container holds everything and sets the width — it hugs its content between a 200px floor and a 340px ceiling. The Arrow points back at the trigger and can sit on any of the four sides. Inside, an optional Title names the toggletip, the Close button dismisses it, and the Content slot takes whatever the consumer puts there. An optional Link closes the block when the toggletip leads somewhere.
A tooltip uses a reduced version of the same anatomy: arrow, container, and a single line of text. It has no title, no close button, no content slot and no link — if you need any of those, you need a toggletip.
When to use it
Section titled “When to use it”The quickest way to choose is to ask what the content is, then how long it runs:
- Not contextual, helpful and non-essential? It doesn’t belong in either — show it on the page.
- Four words or fewer, read-only? Tooltip.
- Longer than that, but under ~350 characters? Toggletip.
- Longer than ~350 characters? Modal.
Use a toggletip when:
- An interactive element — a link, a button, a control — has to live inside the overlay.
- Someone needs to make a quick, in-context edit without leaving the page.
Use a tooltip when:
- An icon-only button needs its purpose spelled out.
- A control, value or label needs a quick clarification.
- A word, abbreviation or data label inside text or a table needs a definition.
Avoid both when:
- The information is important or legal — anything someone must see to finish a task, such as errors, instructions or pricing. Use visible helper text, or a modal.
- The content repeats something already visible on the page.
- The content is long. Reach for a modal or a dedicated page section rather than letting the overlay scroll.
Tooltips carry two extra restrictions: never put interactive content inside one (that makes it a toggletip), and never rely on one for information that matters on touch devices.
Properties
Section titled “Properties”Activation
A toggletip opens on click or Enter and stays until it is dismissed. A tooltip appears on hover or focus and hides again on blur, pointer-leave or Escape. This is the property everything else follows from — it decides whether focus can move inside, and therefore whether the overlay may hold controls.
Content
A toggletip takes text and interactive elements. A tooltip takes read-only text only. There is no middle ground: the moment an overlay contains something focusable, it stops being a tooltip.
Placement
Both forms auto-position by default so they stay fully visible in the viewport. They can also be pinned to the top, right, bottom or left of the trigger. Whichever you pick, the overlay should not cover important content, and should not be clipped by the viewport or a neighbouring element.
Content slot
The toggletip’s replaceable slot accepts custom content — formatted text, a small set of controls, or a component instance. Anything interactive inside it takes part in the toggletip’s focus order, so keep the sequence predictable and the set small.
Width
The toggletip hugs its content between a 200px minimum and a 340px maximum, so short labels and longer translations both fit without truncation or horizontal scrolling. A tooltip drops the minimum and hugs freely, which keeps a two-word chip tight; it keeps the maximum, so a long string wraps rather than running off-screen.
Platform considerations
Section titled “Platform considerations”Desktop
Both forms work. Tooltips open on hover or keyboard focus; toggletips open on click and persist until dismissed. This is the only platform where a tooltip is fully reliable, because it is the only one with a real hover state.
Tablet
Mixed input. Toggletips are unaffected — a tap is a click. Tooltips become unreliable as hover disappears; reserve them for controls that can take keyboard focus, and don’t let anything important depend on them.
Mobile
Avoid tooltips: there is no hover, so the content is simply unreachable. Replace them with a toggletip, which a tap opens correctly. Don’t reach for a long-press instead — it isn’t a native pattern and people don’t discover it. If the content feels important enough that you’re wondering how to surface it on mobile, it probably shouldn’t be a tooltip at all: tooltips are non-essential by definition, and if it matters on mobile it matters everywhere, so display it permanently.
Best practices
Section titled “Best practices”Pick the form that matches the interaction, then keep the content small enough that the form still fits.
Do
Use tooltips for short, read-only explanations on hover or focus, and toggletips whenever the overlay needs a control. Give every toggletip an explicit close affordance. Keep the content compact enough that it never scrolls. Stick to one topic per overlay, splitting anything more complex into separate tips or a larger component. Position the arrow so it clearly points back at its trigger. Replace tooltips with toggletips on touch.
Don't
Don’t put buttons, links or form controls inside a tooltip — that’s a toggletip. Don’t use either form for information required to complete a task, or for errors, instructions and pricing. Don’t let an overlay scroll; if it needs a scrollbar, it needs a modal or a page section. Don’t repeat copy that is already on the page. Don’t rely on a long-press to surface a tooltip on touch.
Content guidelines
Section titled “Content guidelines”Keep the copy short, plain and focused on one idea, and lead with the most important word so it can be scanned rather than read.
Tooltips are the tighter of the two. An icon-button label runs two to four words; a definition, one sentence; a piece of supplemental help, one or two short sentences. For an icon-only button the tooltip should normally say the same thing as the button’s own name — “Delete item” paired with the label “Delete item”, not a re-worded “Remove this item permanently”. Avoid lists, headings and italics inside a tooltip; if the copy needs structure, it has outgrown the form.
Toggletips stretch to one to three short sentences and may carry a link or a button, but only ones that are genuinely necessary. Keep the title, body and link in that order so the reading and announcement sequence stays predictable, and check the wrapping at longer languages such as German and Finnish — both forms grow vertically, so avoid fixed heights.
A toggletip is a floating content container that appears relative to a trigger element.
<div class="tng-toggletip is-contrast"> <div class="tng-toggletip-bubble"> <p class="tng-text-body">…</p> </div></div>Sit sit occaecat minim aute tempor veniam Lorem non et anim. Id in quis eiusmod ea velit sit qui aute cillum aliquip ad aliqua ex. Proident irure proident labore occaecat ex velit Lorem.
Sit sit occaecat minim aute tempor veniam Lorem non et anim. Id in quis eiusmod ea velit sit qui aute cillum aliquip ad aliqua ex. Proident irure proident labore occaecat ex velit Lorem.
Tooltip variant
Section titled “Tooltip variant”The read-only form is the same component with role="tooltip" on the root. That one attribute switches it to the compact chip: tighter padding, a smaller radius and a smaller arrow. The styling is deliberately keyed off the role rather than a modifier class, so the chip look can’t be applied without the semantics that make it announce correctly.
A tooltip hugs its content instead of holding the toggletip’s 200px minimum. It still wraps at the shared maximum — keep the copy to a few words and it will sit on one line.
<div class="tng-toggletip is-contrast" role="tooltip"> <div class="tng-toggletip-arrow" data-placement="bottom"></div> <div class="tng-toggletip-bubble"> <p class="tng-text-body">Measured on the WLTP cycle</p> </div></div>Measured on the WLTP cycle
Measured on the WLTP cycle
Elements
Section titled “Elements”An arrow can be placed at top, right, bottom or left using the data-placement attribute.
<div class="tng-toggletip is-contrast"> <div class="tng-toggletip-arrow" data-placement="top"></div> <div class="tng-toggletip-bubble"> <p class="tng-text-body">…</p> </div></div>Sit sit occaecat minim aute tempor veniam Lorem non et anim. Id in quis eiusmod ea velit sit qui aute cillum aliquip ad aliqua ex. Proident irure proident labore occaecat ex velit Lorem.
Sit sit occaecat minim aute tempor veniam Lorem non et anim. Id in quis eiusmod ea velit sit qui aute cillum aliquip ad aliqua ex. Proident irure proident labore occaecat ex velit Lorem.
Backdrop
Section titled “Backdrop”<div class="tng-backdrop"></div><div class="tng-toggletip is-contrast"> <div class="tng-toggletip-bubble"> <p class="tng-text-body">…</p> </div></div>Sit sit occaecat minim aute tempor veniam Lorem non et anim. Id in quis eiusmod ea velit sit qui aute cillum aliquip ad aliqua ex. Proident irure proident labore occaecat ex velit Lorem.
Sit sit occaecat minim aute tempor veniam Lorem non et anim. Id in quis eiusmod ea velit sit qui aute cillum aliquip ad aliqua ex. Proident irure proident labore occaecat ex velit Lorem.
Close button
Section titled “Close button”<div class="tng-toggletip is-contrast"> <div class="tng-toggletip-bubble"> <button class="tng-icon-button is-ghost" aria-label="Close"> <i class="tng-icon icon-close" aria-hidden="true"></i> </button> <p class="tng-text-body">…</p> </div></div>Sit sit occaecat minim aute tempor veniam Lorem non et anim. Id in quis eiusmod ea velit sit qui aute cillum aliquip ad aliqua ex. Proident irure proident labore occaecat ex velit Lorem.
Sit sit occaecat minim aute tempor veniam Lorem non et anim. Id in quis eiusmod ea velit sit qui aute cillum aliquip ad aliqua ex. Proident irure proident labore occaecat ex velit Lorem.
<div class="tng-toggletip is-contrast"> <div class="tng-toggletip-bubble"> <div class="tng-text-title">…</div> <p class="tng-text-body">…</p> </div></div>Sit sit occaecat minim aute tempor veniam Lorem non et anim. Id in quis eiusmod ea velit sit qui aute cillum aliquip ad aliqua ex. Proident irure proident labore occaecat ex velit Lorem.
Sit sit occaecat minim aute tempor veniam Lorem non et anim. Id in quis eiusmod ea velit sit qui aute cillum aliquip ad aliqua ex. Proident irure proident labore occaecat ex velit Lorem.
Compose the link with .is-neutral so it adopts the toggletip’s foreground colour instead of the default link blue.
<div class="tng-toggletip is-contrast"> <div class="tng-toggletip-bubble"> <p class="tng-text-body">…</p> <a class="tng-link is-neutral">Link</a> </div></div>Sit sit occaecat minim aute tempor veniam Lorem non et anim. Id in quis eiusmod ea velit sit qui aute cillum aliquip ad aliqua ex. Proident irure proident labore occaecat ex velit Lorem.
LinkSit sit occaecat minim aute tempor veniam Lorem non et anim. Id in quis eiusmod ea velit sit qui aute cillum aliquip ad aliqua ex. Proident irure proident labore occaecat ex velit Lorem.
LinkRecipes
Section titled “Recipes”Tooltip
Section titled “Tooltip”This is a tooltip.
Toggletip
Section titled “Toggletip”This is a toggletip with interactive content.
The component covers two patterns, and which one applies is decided by the form you reach for. The interactive toggletip is a Disclosure — a trigger that shows and hides a panel, with its open state exposed on the trigger — and the panel itself is a non-modal dialog. The read-only tooltip is the Tooltip pattern: supplemental text attached to a trigger, never focusable, never interactive. Both meet WCAG 2.1 AA. Neither is modal: focus is not trapped, the trigger keeps or regains it, and the browser weaves the panel into the tab order rather than sealing anyone inside it. An accessible toggletip stays reachable and dismissible from the keyboard, keeps assistive technology informed of its open state, and gives its trigger and its surface an accessible name.
For designers
Section titled “For designers”- Text, icons and their background must meet contrast on every supported surface, in both the neutral and contrast (
is-contrast) schemes. Normal text needs 4.5:1 and large text 3:1, and the overlay’s own background or border needs 3:1 against the page behind it so its edge is discernible. Source: WCAG 1.4.3 Contrast (Minimum). - State must never be carried by colour alone — pair it with text, an icon or a shape. Source: WCAG 1.4.1 Use of Color.
- Focus styles must stay visible, clear hover, and reach 3:1 against their surroundings on every supported surface. Source: WCAG 2.4.7 Focus Visible.
- Content shown on hover or focus must be dismissible, hoverable and persistent — a tooltip has to survive the pointer travelling towards it, and stay until it is dismissed or focus leaves. Never hide one on a timer. Source: WCAG 1.4.13 Content on Hover or Focus.
- Give every toggletip a visible close affordance. Escape and click-outside come free from the platform, but neither is discoverable by looking.
- Interactive targets inside the overlay — the close button above all — need at least 24×24px. Source: WCAG 2.5.8 Target Size (Minimum).
- Position the arrow so it plainly references its trigger, and leave enough room that the overlay neither covers the trigger nor crowds its neighbours.
- Use semantic colour tokens rather than fixed values, so the overlay adapts across schemes and surfaces.
For developers
Section titled “For developers”Build both forms on the native HTML Popover API — the trigger carries popovertarget, the surface carries popover — and the browser does the hard parts for you: it promotes the surface to the top layer, light-dismisses on outside click and Escape, places the surface in the sequential tab order straight after its trigger, and returns focus to the trigger on close. Use popover="auto" for the toggletip and popover="hint" for the tooltip, so a tooltip can appear without dismissing an open toggletip.
Take the platform’s behaviour as the default and don’t fight it. In particular, do not move focus into the surface when it opens, and do not add a focus trap or a manual focus-return — the toggletip is non-modal, and the browser’s own sequence already lets someone Tab into the panel and back out. Anything focusable inside the panel simply takes its place in that sequence, so keep the set of controls small and its DOM order sensible.
A tooltip holds short, non-interactive text and never takes focus itself. If the content needs a link or a button, it is a toggletip — swap the form rather than making a tooltip focusable. Prefer a real element over the native title attribute, whose handling across screen readers, keyboards and touch is inconsistent. Keeping the surface in the DOM and toggling visibility tends to give more reliable assistive-technology support than mounting and unmounting it.
Two timing and placement details: delay a hover-triggered tooltip by roughly 300–500ms so it doesn’t fire on a passing pointer, and never auto-dismiss it. Both forms should flip and shift to stay inside the viewport rather than being clipped at an edge. Each element’s role, accessible name and state are in Labelling elements below; decorative icons stay out of the accessibility tree.
Keyboard interaction
Section titled “Keyboard interaction”| Key | Action |
|---|---|
| Enter / Space | With the trigger focused, open or close the toggletip |
| Escape | Dismiss the open toggletip or tooltip; focus returns to the trigger |
| Tab / Shift + Tab | Move into the open toggletip and through its content, then on to the next / previous control — focus is not trapped |
A tooltip appears when its trigger takes focus or hover and hides on blur, pointer-leave or Escape; it never receives focus. Every trigger and every control inside a toggletip must be operable from the keyboard alone. Source: WCAG 2.1.1 Keyboard.
Labelling elements
Section titled “Labelling elements”Give every element the role, name and state assistive technology needs. The two forms share one design but carry different semantics, so they are documented separately — each demo stacks the trigger with the surface it opens. The content slot is a placeholder, since consumer-slotted content carries its own component’s semantics.
Toggletip
Section titled “Toggletip”The interactive form: a role="dialog" panel that may hold controls.
- Toggletip trigger
- Toggletip
- Close button
Toggletip trigger
A button carrying popovertarget to toggle the panel. Keep aria-expanded in sync with the open / closed state — the recipe updates it on the panel’s toggle event. Name an icon-only trigger with aria-label; otherwise its text content is its name.
Toggletip
role="dialog" on the surface. Name it with aria-labelledby pointing at the visible title, or aria-label when there is no title — a dialog with no name announces only as “dialog”.
Close button
An icon-only button with popovertarget set to the panel’s id so it closes the panel. Give it aria-label="Close"; its icon is decorative.
Tooltip
Section titled “Tooltip”The read-only form: a role="tooltip" bubble of short text. Nothing inside takes focus, and the bubble takes no name of its own — its text content is what gets announced.
Battery range is measured on the WLTP cycle.
- Tooltip trigger
- Tooltip
Tooltip trigger
Which attribute you use depends on what the tooltip text is. When it supplements a control that already has a name, point aria-describedby at the tooltip’s id so the text is announced as a description. When the tooltip carries the control’s only name — the usual case for an icon-only button — use aria-labelledby instead; pairing aria-describedby with text that duplicates the button’s aria-label makes screen readers announce the same words twice.
Tooltip
role="tooltip" on the bubble — the same attribute the styleguide keys the compact chip styling off, so the look and the semantics cannot drift apart. It is not focusable and takes no name of its own.
Source: WCAG 4.1.2 Name, Role, Value.