# Attention Map Popover

> An AI attention-pattern popover: a 5x5 query/key attention heatmap with token-labeled axes, highlighted attended tokens, a weight legend and a live model status footer, revealed from a trigger button with click-outside and Escape to close.

- Category: Popover
- Frameworks: Vanilla, React + CSS, React + Tailwind
- Design system: Triangulum
- Dark mode: yes
- Access: premium (Atheros AI Pass)
- Tags: ai, visualization
- Page: https://builder.atheros.ai/components/attention-map
- Preview: https://d17nmjscumqk5d.cloudfront.net/builder/templates/tpl_builder_attention_map/preview-2fbbc768f02f.webp

## Features

- Trigger button that toggles an anchored attention popover open and closed
- 5x5 query/key attention matrix — row tokens attend to column tokens, so the bright diagonal reads as self-attention
- Token axis labels on both axes: rotated key tokens across the top, query tokens down the left, aligned to the heatmap tracks
- The focused `deep` token is emphasized typographically on both axes without label background fills
- Hover a heatmap cell to spotlight it and read its `query → key · weight` tooltip
- Legend row with an axis hint ("rows attend to columns") and a 0→1 weight scale
- Live model status footer with a pulsing activity dot
- Click outside the popover or press Escape to dismiss it
- Responsive down to 240px
- Fully respects `prefers-reduced-motion`

## Accessibility

- **Dialog role** — The popover uses `role="dialog"` with an `aria-label`
- **Trigger semantics** — The trigger has `aria-haspopup`, `aria-expanded` and `aria-controls`
- **Informative heatmap** — The labeled matrix is exposed as `role="img"` with an `aria-label` naming the tokens, the query/key axes, and the diagonal self-attention pattern
- **Cell tooltips** — Each cell carries a `title` of the form `query → key · weight` for sighted hover reading
- **Decorative visuals** — The legend and arrow are `aria-hidden`
- **Focus indicators** — `:focus-visible` with `--ring` outline on all interactive elements
- **Reduced motion** — `prefers-reduced-motion: reduce` disables all animations

## Keyboard shortcuts

- `Escape` — Close the popover and restore focus to the trigger

## Common questions

**Which frameworks is Attention Map Popover available in?**

Attention Map Popover ships as Vanilla, React + CSS and React + Tailwind — HTML, CSS, JS and React source you can copy, download or clone into Atheros AI Builder.

**Is Attention Map Popover free?**

Attention Map Popover is a premium component. Anyone can preview it; the source, downloads and AI customisation are included with Atheros AI Pass.

**Does Attention Map Popover support dark mode?**

Yes. Attention Map Popover ships light and dark themes, both drawn from the Triangulum design system's tokens. Switch the preview to dark mode to compare them.

## Get the code

Preview Attention Map Popover live, then sign in to copy or download the source, apply another design system, or ask the AI assistant to change it: https://builder.atheros.ai/components/attention-map

Every component on https://builder.atheros.ai is also reachable from Claude Code, Cursor and Codex through the Atheros MCP server (paid plans). Component index: https://builder.atheros.ai/llms-components.txt
