Skip to content

ContextWindowMeter

stablev1.0.0

Visualizes token usage across a conversation context window. Renders a segmented bar (system/user/assistant/tools), overflow warning state, and legend. Semantic colors from Tokens v2. Warning at 80%, critical at 95%.

ai-agent/Storybook ↗
import { ContextWindowMeter } from "@nodus/design-system"
Loading demo…

Props

segmentsrequired
Type TokenSegment[]Default

Individual segments of the context window (label + tokens).

limitrequired
Type numberDefault

Total context window capacity in tokens.

model
Type stringDefault

Model name displayed in the header.

warnAt
Type numberDefault 0.8

Warning threshold (0–1).

criticalAt
Type numberDefault 0.95

Critical/overflow threshold (0–1).

showLegend
Type booleanDefault true

Show per-segment legend below the bar.

compact
Type booleanDefault false

Compact mode: bar + total only.

Metadatasemantictypesurfaceoutcome
Design Rationale

This component was designed to express:

Explore Related

Was this helpful?