Menu
A card of actions and options that slides out from under its key. The key stays down while the card is out; an option that is on lights its lamp.
Kit part · Popovers
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.
Reserve
Kept for a power cut.
Reserve
Kept for a power cut.
Reserve
Kept for a power cut.
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
| Part | Key | Card out, below | Above | Focus in the card |
|---|---|---|---|---|
| Popover | Reserve Kept for a power cut. | Reserve Kept for a power cut. | Reserve |
Graphite
| Part | Key | Card out, below | Above | Focus in the card |
|---|---|---|---|---|
| Popover | Reserve Kept for a power cut. | Reserve Kept for a power cut. | Reserve |
| Name | Kind | Values | What it does |
|---|---|---|---|
| .tui-popover | class | on [popover] | The card: a raised plate, 12px corners, 16px inside, up to 300px wide. |
| popover | attribute | native | Top layer, light dismiss, Escape. Leave it off for a card that sits in the page. |
| popovertarget | attribute | on the key | Native: the key opens and closes the card; the browser links them for assistive tech. |
| .tui-popover__trigger | class | on a .tui-key | Stays latched while its card is out. |
| data-side | attribute | "bottom" · "top" · "right" · "left" | Where the card prefers to hang. It flips to the opposite side when there is no room. |
| data-align | attribute | "center" · "start" · "end" | Where along that side. It slides to stay 8px inside the window. |
| role="dialog" · aria-labelledby | attribute | — | For a card with keys or fields in it. A card of words alone can be role="note". |
| .tui-popover__title · .tui-popover__actions | class | — | A bold first line; keys at the foot, right-aligned. |
| .tui-popover--plain | class | — | No leader. |
| --tui-leader | CSS property | set by script | Where the leader meets the card, in px from its edge: under the key’s centre. |
| data-placed | attribute | set by script | The side it was placed on; the leader and the slide follow it. |
| placePopover(card, anchor, options) | function | kit.mjs | Place any fixed card beside an element or a point; the menu and the notification centre use it. |
| Enter · Space · Escape · Tab | keyboard | — | Open and close from the key; Escape closes and returns focus; Tab walks into the card after the key. |
<button class="tui-key tui-popover__trigger" popovertarget="tariff">Tariff</button>
<div class="tui-popover" id="tariff" popover role="dialog" aria-labelledby="tariff-t">
<p class="tui-popover__title" id="tariff-t">Flux, three rates</p>
<p>Cheapest 00:00–02:00, dearest 16:00–19:00.</p>
<div class="tui-popover__actions">
<button class="tui-key tui-key--flat tui-key--sm" popovertarget="tariff" popovertargetaction="hide">Close</button>
<button class="tui-key tui-key--primary tui-key--sm">Change tariff</button>
</div>
</div>import '/kit/kit.mjs'; // places every .tui-popover as it opens
// Prefer a side: data-side="top" on the card; data-align="start" | "end".
// For your own floating parts:
import { placePopover } from '/kit/kit.mjs';
placePopover(card, key, { side: 'bottom', align: 'center', gap: 14 });Needs kit.css and kit.mjs. How to install the kit.
popover with popovertarget: the key is announced as expanded or collapsed, and Tab goes from the key straight into the card.::before and ::after: nothing to announce.Opening and closing are the browser’s; popover.mjs answers the toggle event, measures the key and the card, and places the card below it (or above, or beside), sliding it to stay inside the window. It writes --tui-leader, and the card’s ::before draws a hairline across the 14px gap to that point while its ::after puts a dot on the key’s edge: a callout from a manual. The arithmetic is a pure function with its own tests. The card hangs down 5px in 160ms.
For a closer look at something beside it, never for a decision that must be made now; that is a dialog.
4 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.
A card of actions and options that slides out from under its key. The key stays down while the card is out; an option that is on lights its lamp.
A one-line name for an icon key, printed on a small dark plate above it on hover and on keyboard focus.
Confirm
Erase reel 3?
A decision that must be made now: a native dialog with a question, one sentence of consequence, a way back and the act.