Context Meter
NewHow full the model's context window is: a ring in the composer that opens into a breakdown by source.
Installation
$ pnpm dlx shadcn@latest add @synccn/context-meterFirst time in this project? Connect synccn with one command.
Usage
import { ContextMeter } from "@/components/ui/context-meter";<ContextMeter used={68400} limit={200000} breakdown={parts} />API reference
Generated from the component's TypeScript types, so it always matches the code.
ContextMeter
How full the model's context window is: a small ring in the composer that opens into a breakdown by source.
- usedrequired
numberTokens in the conversation now.
- limitrequired
numberThe model's context window, in tokens.
- breakdown
ContextPart[]What the tokens are made of: system prompt, messages, files, tools.
- warnAt
numberDefault
0.8Share of the window at which it turns amber, from 0 to 1.
- hint
stringShown in the panel when near the limit, e.g. what happens next.
- side
"top" | "bottom"Default
"top"Opens the panel above or below the button.
- className
stringExtra classes for the root element.
Dependencies
Read from the component's imports when the site builds. The CLI installs all of these for you.
Keyboard
- EnterorSpaceOpen the breakdown
- EscClose it
Accessibility
- The button's label says how full the window is in words and numbers.
From the source
Read from this component's code when the site builds, so it can't drift.
- ARIA attributes: aria-controls, aria-expanded, aria-label
- Closes with Escape
- Closes when you click or tap outside