Skip to content
IndexRequest a UIAboutContact

Context Window Usage Meter

A stacked bar of how much context is used by instructions, history, files and reply room.

Open alone ↗

AI prompt

PROMPT: PASTE INTO YOUR AI CODING TOOL
Clean UI mockup of a chat sidebar footer with a horizontal context usage bar split into four segments, a dark grey System part, a blue Conversation part, a purple Attachment part and a hatched Reserved for reply part, the label 6,420 of 8,000 tokens used, an amber warning line below reading Earlier messages may be forgotten with a small Summarise button, light theme, flat modern style. Negative: gradients, 3D, clutter, text errors. Reduced motion: static design.

About this pattern

Definition

Every model can read only so much text at once. A context meter shows people how full the window is, so they understand why a very long chat starts to forget early messages. Splitting the bar into parts shows what takes the space and what can be trimmed.

Purpose & UX principles

  • Show segments: instructions, conversation, attachments and the space reserved for the reply.
  • Use calm colours until about 80 percent, then a warning with a suggested action such as summarise earlier messages or start a new chat.
  • Display approximate numbers and say they are estimates.
  • Always keep room for the answer; block a send that would leave none.

Interaction states

  • A Messages slider and an Attach file switch change usage.

Motion specification

  • The bar updates in 200ms.
  • Reduced motion: no transition.

Responsive behaviour

  • Give the bar a text equivalent, such as 74 percent used.
  • Do not alarm users early; reserve strong colours for real limits.

Code

HTML
<div class="bx"><div class="mb" id="mb" role="img" aria-label="Context usage"><i class="s1"></i><i class="s2"></i><i class="s3"></i><i class="s4"></i></div><p class="lg" id="lg"></p><p class="wr" id="wr" role="status"></p><label class="rw">Messages in chat <b id="mv">12</b><input id="ms" type="range" min="0" max="48" value="12"></label><label class="sw"><input id="at" type="checkbox"> Attach a long document</label></div>

Related patterns

Streaming Chat Response

↗
Streaming Chat ResponseAI & Conversational

Agent Steps Timeline

↗
Agent Steps TimelineAI & Conversational

Character Counter & Limit

↗
Character Counter & LimitInputs & Forms