KQ-770 · TOOL/BUDGET
Tool Budget
A meter of tool calls and the rail that spends them. Each call drains the rightmost filled segment on glide and the count of calls left rolls on snap; at the warn line the remaining segments pulse and the readout says low; at zero the meter turns danger, a hatch fades over the rail and a lock lands on flick. The rail is a toolbar with a roving tabindex, and locked tools stay focusable with aria-disabled.
KQ-770 · TOOL/BUDGET
Fernworks Model 3 · tool calls/ 10 left
10 of 10 left
Install
One command — the source lands in your repo. Or copy it from the Code tab.
$ pnpm dlx shadcn@latest add @kinetiq/tool-budget
Props
- budget
- number
- default —
- Total calls allowed; one segment each.
- used
- number
- default —
- Calls spent so far, clamped to the budget.
- tools
- BudgetTool[]
- default —
- The rail of tools; each may carry the calls it has made.
- warnAt
- number
- default 3
- Calls left at which the remaining segments start to pulse.
- onCall
- (toolId: string) => void
- default —
- Fires from a tool control while calls remain.
- label
- string
- default —
- Names the meter and the rail.
| Prop | Type | Default | Description |
|---|---|---|---|
| budget | number | — | Total calls allowed; one segment each. |
| used | number | — | Calls spent so far, clamped to the budget. |
| tools | BudgetTool[] | — | The rail of tools; each may carry the calls it has made. |
| warnAt | number | 3 | Calls left at which the remaining segments start to pulse. |
| onCall | (toolId: string) => void | — | Fires from a tool control while calls remain. |
| label | string | — | Names the meter and the rail. |