ns-ui

Meter Context Window

A context-window budget meter: one hairline stacked bar segmenting the window into system prompt / tools / history / current turn, told apart by fill pattern instead of color, that visibly resettles rather than jumps when the window compacts.

Use when a read-only budget readout for an already-composed context window, splitting it into system prompt, tools, history and current turn by fill pattern rather than color so the shares survive a monochrome or colorblind read, and resettling rather than jumping when a compaction lands; pick context-prompt-shims instead when the user decides what goes in and in what order, or context-compaction-river when the interesting thing is which turns were compacted away and whether they can come back.

Install

npx shadcn add https://design.helpmarq.com/r/meter-context-window.json
  • meter
  • progress
  • context-window
  • tokens
  • llm
  • agent
  • data-viz
  • mono
  • dashboard
  • budget
  • accessibility

ns-ui / meter-context-window

AGENT SESSIONclaude-4.5 · 200,000 ctx

103,600 / 200,000 tokens · 52%

  • System3,4002%
  • Tools2,1401%
  • History96,80048%
  • Turn1,260<1%
  • Free96,40048%

event · session resumed · 51.8% of window in use

52% of window

the bar is a picture of what the model can see right now — compact when history dominates and watch it resettle, not jump

Props

PropTypeDefaultDescription
capacitynumbertotal size of the context window, in tokens
systemnumbertokens spent on the system prompt
toolsnumbertokens spent on tool/function definitions and results
historynumbertokens spent on prior conversation turns
turnnumbertokens spent on the turn currently being read or generated
lowFreeThreshold?numberfraction of capacity (0-1) below which the free segment is flagged as low headroom. default 0.08 (8%)
ariaLabel?stringaccessible name for the meter. default "Context window budget"
className?string