✨ CSS anchor positioning + Popover API
Constellation Map
Tooltip positioning logic that took 200+ lines of floating-UI JavaScript is now four lines of CSS, with browser-managed dismiss, stacking and keyboard handling.
Use it for: Interactive maps · onboarding tours · data tooltips
Teach_ing
Physics, chemistry, biology, neuropsychology — half a decade of igniting students.
Koach_ing
1:1 transformation. The G.E.M. framework, from diagnostic to lift-off.
Perform_ing
TEDx: The 3 Laws of Emotion. Flowcus Pocus. Two decades on stage.
Invent_ing
The Philosopher's Pen_Cil — writing tools for states of flow.
click a star ✦ tooltips are CSS-anchored native popovers — zero positioning JS
The complete source
This is the exact file rendering the demo above — a single self-contained React client component with its styles inline. Copy or download it, drop it into any React / Next.js project, and it runs. No extra dependencies.
1"use client";23/* ============================================================4CONSTELLATION MAP — CSS Anchor Positioning + the Popover API.5Supported in all major browsers as of late 2025.6Each star is an anchor; its tooltip tethers itself with7position-area + position-try fallbacks. The popovers open and8close with ZERO JavaScript — the `popovertarget` attribute9does the wiring, the browser handles dismiss & stacking.10============================================================ */1112const STARS = [13{ id: "teach", x: 18, y: 30, label: "Teach_ing", info: "Physics, chemistry, biology, neuropsychology — half a decade of igniting students." },14{ id: "koach", x: 42, y: 62, label: "Koach_ing", info: "1:1 transformation. The G.E.M. framework, from diagnostic to lift-off." },15{ id: "perform", x: 66, y: 26, label: "Perform_ing", info: "TEDx: The 3 Laws of Emotion. Flowcus Pocus. Two decades on stage." },16{ id: "invent", x: 84, y: 58, label: "Invent_ing", info: "The Philosopher's Pen_Cil — writing tools for states of flow." },17];1819export default function Anchors() {20return (21<div className="anchor-wrap">22<style>{`23.anchor-wrap {24position: relative; height: 60svh; border-radius: 24px;25border: 1px solid rgba(255,255,255,.15); overflow: clip;26background:27radial-gradient(circle at 20% 80%, rgba(124,58,237,.25), transparent 50%),28radial-gradient(circle at 80% 20%, rgba(6,182,212,.2), transparent 50%),29#0a0a12;30}31.anchor-star {32position: absolute; translate: -50% -50%;33width: 22px; height: 22px; border-radius: 50%;34background: radial-gradient(circle at 35% 35%, #fff, #ffa500 60%, transparent);35box-shadow: 0 0 18px 4px rgba(255,165,0,.55);36border: none; cursor: pointer;37animation: star-pulse 2.4s ease-in-out infinite;38}39.anchor-star:hover { animation-play-state: paused; scale: 1.3; }40@keyframes star-pulse { 50% { box-shadow: 0 0 28px 8px rgba(255,165,0,.8); } }4142/* anchor names — one per star */43${STARS.map(44(s) => `45#star-${s.id} { anchor-name: --star-${s.id}; left: ${s.x}%; top: ${s.y}%; }46#tip-${s.id} {47position-anchor: --star-${s.id};48position-area: top;49position-try-fallbacks: bottom, left, right;50margin: 12px;51}`52).join("\n")}5354/* the tooltips are native popovers — no JS open/close */55.anchor-tip {56position: fixed; /* required for anchor positioning */57width: min(34ch, 70vw);58border: 1px solid rgba(255,255,255,.25); border-radius: 16px;59background: rgba(16,16,28,.92); color: #fff;60padding: 1.6rem; font-size: 1.4rem; line-height: 1.6;61backdrop-filter: blur(8px);62box-shadow: 0 18px 50px rgba(0,0,0,.5);63}64.anchor-tip::backdrop { background: transparent; }65.anchor-tip h4 { font-size: 1.7rem; font-weight: 800; margin-bottom: .6rem; color: #ffa500; }66.anchor-tip p { color: rgba(255,255,255,.82); }6768/* connecting constellation lines (decorative) */69.anchor-lines { position: absolute; inset: 0; pointer-events: none; opacity: .35; }7071.anchor-help {72position: absolute; bottom: 12px; left: 50%; translate: -50% 0;73font-size: 1.25rem; color: rgba(255,255,255,.55);74background: rgba(0,0,0,.4); padding: .5rem 1.4rem; border-radius: 999px;75}76`}</style>7778<svg className="anchor-lines" viewBox="0 0 100 100" preserveAspectRatio="none" aria-hidden="true">79<polyline80points={STARS.map((s) => `${s.x},${s.y}`).join(" ")}81fill="none"82stroke="rgba(255,255,255,.5)"83strokeWidth="0.18"84strokeDasharray="1.5 1.2"85/>86</svg>8788{STARS.map((s) => (89<button90key={s.id}91id={`star-${s.id}`}92className="anchor-star"93popoverTarget={`tip-${s.id}`}94aria-label={`Open ${s.label}`}95/>96))}9798{STARS.map((s) => (99<div key={s.id} id={`tip-${s.id}`} className="anchor-tip" popover="auto">100<h4>{s.label}</h4>101<p>{s.info}</p>102</div>103))}104105<p className="anchor-help">106click a star ✦ tooltips are CSS-anchored native popovers — zero positioning JS107</p>108</div>109);110}111