# Context Window Popover

> A context-window usage popover: a segmented usage bar splitting system, history, tools, docs and prompt tokens across a vibrant multi-hue data palette, a color-coded legend with token counts and a remaining-capacity footer, revealed from a trigger with click-outside and Escape to close.

- Category: Popover
- Frameworks: Vanilla, React + CSS, React + Tailwind
- Design system: Runway
- Dark mode: yes
- Access: premium (Atheros AI Pass)
- Tags: ai
- Page: https://builder.atheros.ai/components/context-window
- Preview: https://d17nmjscumqk5d.cloudfront.net/builder/templates/tpl_builder_context_window/preview-7b720f3e874b.webp

## Features

- Trigger button that toggles an anchored context-usage popover
- Segmented usage bar splitting system, history, tools, docs and prompt tokens with a distinct vibrant colour per category
- Neutral (near-white / near-black) prose with strong colour reserved for the data segments and legend dots
- Color-coded legend with per-segment token counts
- Header readout of used versus total context capacity
- Footer summarizing percent used and remaining capacity
- Click outside the popover or press Escape to dismiss it
- Responsive down to 240px
- Fully respects `prefers-reduced-motion`
- Static, populated first paint: the panel ships its real content in markup (no skeleton, no async fetch); init re-renders atomically from the in-file data model, so there is no empty frame or height jump on load

## Accessibility

- **Dialog role** — The popover uses `role="dialog"` with an `aria-label`
- **Trigger semantics** — The trigger has `aria-haspopup`, `aria-expanded` and `aria-controls`
- **Decorative visuals** — The arrow and usage bar 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 Context Window Popover available in?**

Context Window 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 Context Window Popover free?**

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

**Does Context Window Popover support dark mode?**

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

## Get the code

Preview Context Window 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/context-window

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
