Skip to the page
Tactile UI

Kit part · Tooltips

Toggletip

A small round key beside a label that, when pressed, hangs a sentence or two about it on a label plate and says them aloud. The tooltip names a key on hover and never opens on touch; a toggletip is for words a person may need to read before they choose, so it opens on a press, on a phone as on a desk, and stays until it is pressed again, Escape is pressed, a press lands outside it or focus moves on. The note is written into a polite status line as it opens, so a screen reader hears it once. Without the script the note is printed in place after the label.

Element
<tui-toggletip label="About the billing day">
Needs
kit.css + kit.mjs
Covers
Toggletip · Info tip
Rules
toggletip.rules.md · 8
Finishes
Aluminium · Graphite · Oak · Walnut · Porcelain · Black · Daylight · Night · Paper · Phosphor · E-paper · AMOLED
Volumes
Tactile · Quiet
On this page
  1. Variants
  2. Every state, at once
  3. API
  4. Markup
  5. Accessibility
  6. How it’s built
  7. Rules
  8. Related parts

Seats open in 11 days. Want one email that morning?

Variants

The info mark · open
A seat is one person who can sign in. Guests who only read shared pages need no seat.
The question mark · icon="question"
Below its key · side="bottom"
Retention
Beside its key · side="right"
Two-step sign inAfter your password you type a six-digit code from your phone. It stops anyone who has only your password.
Beside a heading

Every state, at once

Both finishes, side by side. Hover, pressed and focus are forced with .is-hover, .is-down and .is-focus; checked and disabled are real.

Aluminium

PartAt restHoverFocusOpenWithout script
Toggletip

Billing dayCharged on this day each month.

Graphite

PartAt restHoverFocusOpenWithout script
Toggletip

Billing dayCharged on this day each month.

API

NameKindValuesWhat it does
tui-toggletipelementDraws the round key, the plate and a status line from the words inside it, and opens the plate on a press. One is open at a time.
labelattributetext · “More information”The key’s name for a screen reader: say what the note is about (“About the billing day”), not “Info”.
iconattributeinfo · question · infoThe mark on the key: the info mark for an explanation, the question mark for an answer.
sideattributetop · bottom · right · left · topWhere the plate hangs. It flips to the other side, or slides along, to stay on screen, and never covers its key.
open · show() · hide() · toggle()property · methodbooleanOpen or close it from a script.
notepropertytextThe words. Setting it changes them, and an open note says the new words.
keypropertybuttonThe round key, for a page that wants to focus it.
tui-toggletipeventdetail { open }Fires as it opens and closes, and bubbles.
toggletipName() · toggletipNote() · toggletipHTML()functionpureThe key’s name, the note as one line, and the element as markup (static draws it open, for a specimen).
.tui-toggletip__key · .tui-toggletip__cardclassdrawnThe key (22px, with a 44px press) and the plate.

Markup

<label class="tui-label" for="billing-day">Billing day</label>
<tui-toggletip label="About the billing day">
  Your card is charged on this day each month. A change counts from the next bill.
</tui-toggletip>
<select class="tui-select" id="billing-day">…</select>

<!-- The question mark, and a note that hangs below its key: -->
<tui-toggletip label="What is a seat?" icon="question" side="bottom">A seat is one person who can sign in.</tui-toggletip>
<!-- It writes its own key, the plate and a status line; the words inside are the note. -->
import '/kit/kit.mjs';

const tip = document.querySelector('tui-toggletip');
tip.show();                       // or tip.open = true
tip.hide();
tip.note = 'Charged on the 1st.';  // new words; an open note says them again
tip.addEventListener('tui-toggletip', (e) => console.log(e.detail.open));

Needs kit.css and kit.mjs. How to install the kit.

Accessibility

  • The key is a real button with aria-expanded, named by label; Enter and Space open and close it, as a press does.
  • The plate is decoration for the eyes (aria-hidden): the note is written into a role="status" line a moment after it opens, so a screen reader says it once, politely, and it is taken out again as the plate closes.
  • Escape closes it and keeps focus on the key; tabbing on, or a press anywhere else, closes it too. Nothing inside it takes focus, so it holds no link and no key: what needs a press belongs in a popover.
  • It opens on a press, so it works with touch, a switch or voice control the same as with a mouse; the key is drawn at 22px beside a label, but its press is 44px across.
  • The plate is the tooltip’s contrast plate, so the words hold the kit’s contrast in every finish and both volumes. Its fade is the only motion, and reduced motion leaves it out.

How it’s built

The key is the kit’s round icon key, small, with the icon set’s info or question mark, and it stays down while the note is out. The plate is the tooltip’s label plate grown to a sentence or two, with its printed rule and its tab, placed by the popover’s own placement so it flips and slides like every card in the kit. It sits in the top layer as a manual popover, so no box clips it. No colour is added.

Rules

toggletip.rules.mdIn the brain

A press-to-read note beside a label: a sentence or two that explains a setting, said aloud as it opens.

8 rules in this file, with the foundations they rest on and the anti-patterns that break them. Full rules ship in the brain with the Pass.

Tooltip

A few words on a small label plate, the kind riveted beside a control on a rack: printed in the contrast colours with a rule just inside its edge and a short tab aimed at its key. It comes up when a pointer rests on the key or the keyboard reaches it, is read by a screen reader, and goes on Escape.

Popover

A card hung from the key that opened it, with a printed leader running back to the key. Not modal: the page stays live around it.

Hover card

A preview that hangs from a link when the pointer rests on it or the keyboard reaches it. The popover’s card and leader, opened by a short delay and put away by leaving.

Icon key

A key with an icon and no words, square or round: transport, power, the small tools. Its aria-label names it; a tip shows the name.

Field

Text entry in a recess, the label printed above it, and a hint that says how to fix an error.