Context Meter
A slim capsule showing what fills the model's context: system prompt, files, conversation, the reply. Each part is a step of one ink, with the free space at the end.
Needs: Token counts from your own tokenizer or the API's usage numbers. No model in the browser.
Customize
size
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| used | { label: string; tokens: number }[] | required | What's in the window, in order. Earlier parts are darker; over the limit, the parts share the whole bar. |
| limit | number | 128000 | The model's context window, in tokens. Set it to your model's. |
| size | "sm" | "md" | "lg" | "md" | Bar thickness, width and type size: 200, 280 or 420 px wide at most, filling narrower containers. |
| accent | string | "" | Any CSS colour for the segments; each part is a lighter step of it. The text colour when empty. |
| wordsPerToken | number | 0.75 | Turns free tokens into words for the estimate (pages are 500 words). About 0.75 for English, lower for code or other scripts. |
| label | string | "Context window" | Names the meter for screen readers, which hear the same words as the label. |
| className | string | – | Added to the root element. |
| style | CSSProperties | – | Inline styles on the root; set --mlui-* variables here to theme it. |