Context Budget
ProNewFit sources into a model window with a segmented meter and a live token balance.
Installation
pnpm dlx shadcn@latest add @viewport/context-budget
First time? Add the @viewport registry to components.json. Setup takes one minute.
Usage
The code behind the preview above comes with Truffle Pro.
Props
| Prop | Type | Default |
|---|---|---|
| capacity* | numberMaximum tokens available in the context window. | — |
| layers* | Layer[]Context sources, token costs, display colors and initial inclusion. | — |
| onChange | (ids: string[]) => voidReceives the IDs of all included sources after a change. | — |
Accessibility
- Source switches report their state. Token totals and any overage remain readable as text.