Reserve
Kept for a power cut.
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.
Kit part · Cards & panels · Popovers · Tooltips
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.
Mara Voss
Product designer · Lode
Draws the hub’s panels and its printed legends. Left-handed, likes a 1.6 line.
Design review
Every Thursday at 10:00, in the workshop.
Mara Voss
Product designer · Lode
Draws the hub’s panels and its printed legends. Left-handed, likes a 1.6 line.
Mara Voss
Product designer · Lode
Draws the hub’s panels and its printed legends. Left-handed, likes a 1.6 line.
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
| Name | Kind | Values | What it does |
|---|---|---|---|
| data-hover-card | attribute | a card id | On the trigger (a link or a key): the card that hangs from it. The card is a block, so put it beside the trigger, never inside a paragraph. |
| aria-describedby | attribute | the same id | On the trigger, so the card is read as its description when it gains focus. |
| .tui-popover.tui-hover-card | class | popover="manual" | The card: the popover’s plate and leader, 288px wide, grid of 12px. |
| data-side · data-align | attribute | as for the popover | On the card: where it prefers to hang, and along which edge. It flips when the page runs out. |
| data-open-delay · data-close-delay | attribute | 450 · 200 (ms) | On the trigger. Keyboard focus opens after 250ms. |
| .tui-hover-card__who · __name · __role · __text · __facts | class | — | A head with an avatar, a line of prose, and a row of printed facts. |
| showHoverCard(trigger) · hideHoverCard() | function | kit.mjs | Open one now, and put the open one away. |
| HOVER_OPEN_MS · HOVER_FOCUS_MS · HOVER_CLOSE_MS | constant | 450 · 250 · 200 | The timings. |
| Focus · Escape | keyboard | — | A keyboard-visible focus opens it; Escape closes it and focus stays on the trigger. |
| Tab | keyboard | — | From the trigger goes into the card, which follows it in the source, if it has anything focusable. |
<a class="tui-link" href="/people/mara"
data-hover-card="hc-mara" aria-describedby="hc-mara">Mara Voss</a>
<!-- Straight after its trigger, so a keyboard user can go into it -->
<div class="tui-popover tui-hover-card" id="hc-mara" popover="manual" role="note"
data-side="bottom" data-align="center">
<div class="tui-hover-card__who">
<span class="tui-avatar" role="img" aria-label="Mara Voss">…</span>
<div><p class="tui-hover-card__name">Mara Voss</p>
<p class="tui-hover-card__role">Product designer · Lode</p></div>
</div>
<p class="tui-hover-card__text">Draws the hub’s panels and its printed legends.</p>
<dl class="tui-hover-card__facts">…</dl>
</div>import { showHoverCard, hideHoverCard } from '/kit/kit.mjs';
// Nothing to write: import kit.mjs and every [data-hover-card] works, now and later.
// Timing, per trigger: data-open-delay="450" data-close-delay="200" (milliseconds)
showHoverCard(trigger); // open one yourself
hideHoverCard(); // and put it awayNeeds kit.css and kit.mjs. How to install the kit.
aria-describedby, so a screen reader reads the card as the link’s description; the card is role="note" and holds words, not controls.The card is the popover’s (its plate, its 12px corners, its leader running to the trigger) set with popover="manual" so the browser puts it in the top layer without any light-dismiss of its own. hover-card.mjs owns the timing: a rest of 450ms opens it, and leaving starts a 200ms grace that crossing to the card cancels, so the gap of the leader can be walked. placePopover, the popover’s own arithmetic, chooses the side and slides it to stay inside the window; it follows scrolling and resizing. One card is out at a time.
A glance at who or what a link is, for people who would rather not leave the page yet.
5 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.
Reserve
Kept for a power cut.
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.
A person’s ID plate: their coin set in a countersunk socket, name and role, a rating plate of facts engraved in tabular figures, and one key to act. Compact for one line.
A one-line name for an icon key, printed on a small dark plate above it on hover and on keyboard focus.