hp-unfold-overlay
Lightbox-style hex overlay. Click / tap / Enter on the source opens a hex-
clipped native <dialog> at the viewport centre containing the slotted
detail content. Esc closes natively; a backdrop click closes via a manual
listener (native <dialog> doesn't ship light dismiss). Uses
showModal() so we inherit Top Layer, the ::backdrop pseudo,
and a focus trap for free — no z-index management.
Companion to <hp-unfold-list>
(ring expansion in place) and the still-to-come
<hp-unfold-page> (camera-zoom into a new route via View Transitions).
Three separate primitives with three separate navigation contracts.
Click player to spotlight the profile detail. Esc or backdrop click to close.
kira_chen
Level 42 hexcrafter — Western Loop division
Recent: completed Stardust Refactor · 12 minutes ago
Same element outside a grid — the overlay still centers on the viewport.
Build #4082
Pushed to main by kira_chen
24 commits · 8 files changed · all green
Install
bun add @hexpunk/core lit import "@hexpunk/core"; Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
open | open | boolean | false | Reflected open / closed state. Setting it imperatively calls showModal / close on the inner <dialog>. |
Events
| Event | Type | Description |
|---|---|---|
| CustomEvent | |
hp-unfold-open | Event | When the overlay opens |
hp-unfold-close | Event | When the overlay closes (backdrop or .close()) |
Slots
| Slot | Description |
|---|---|
source | The trigger element (always visible) |
(default) | The overlay body content |
When to use
<hp-unfold-overlay> when the detail view is rich enough
to demand the user's focused attention — profile cards, build details, item cards,
settings panels. The modal contract makes "you're in detail mode" unambiguous.
hp-cell variant="anchor" /
variant="action") — it stays clickable as the trigger and the modal
opens centred on viewport.
<hp-unfold-list>'s job (ring bloom around the source).
<hp-unfold-page>'s job
(cross-document camera-zoom via View Transitions).
Accessibility
showModal() traps focus inside the dialog while it's open and returns focus
to the trigger on close — both native browser behaviours. The source gets
tabindex="0" on slotchange (consumers can override).
aria-pressed on the source mirrors the open state so hp-cell's hue swap
engages without separate wiring.
Reduced motion
With prefers-reduced-motion: reduce, the scale + opacity tweens are
suppressed — the overlay snaps open and closed instantly. The backdrop still appears,
focus trap still engages, hue swap on the source remains (state signal, not
decoration).
Roadmap
unfold-tether token
chain from DESIGN.md), drawn over the backdrop while the overlay is open.
No per-component entries in CHANGELOG.md yet.