ContextMeter

How much of a model’s context window a conversation has used — "12K / 200K" with a bar that warns as it fills

Category: feedback · WCAG 2.2-AA · ai, context, tokens, usage, meter, quota

States

Props

PropTypeDefaultDescription
valuenumber—Tokens used so far.
maxnumber—The context window size, in tokens.
labelstringContextThe meter’s name, shown above the bar.
labels{ usage?: string }—Overrides for the component’s user-visible strings (i18n). `usage` is the spoken value and may contain `{used}`, `{max}` and `{percent}`.

Design tokens

When to use

When not to use

How to build an accessible ContextMeter in React →

Examples

Plenty left

<ContextMeter value={12400} max={200000} />

Nearly full

<ContextMeter value={192000} max={200000} />

Related components

← Back to docs