The assistant's budget at a glance: a context window bar split by what fills it, and the plan's usage limits with reset times. Opens to a full breakdown.
Default
The context window bar split by what fills it, then the plan's limits with reset times. Click the context window row to open the breakdown.
- 5-hour limitResets in 2 hr 46 min38%
- Weekly · all draftsResets Mon 9:00 AM24%
- Weekly · proposalsResets Mon 9:00 AM12%
Installation
Copies the component into src/design-system/ as your own source, with only the files it needs.
npx avesk-ui@latest add agent-limits-cardBrings the 4 files it builds on (button.tsx, glyph.tsx, tooltip.tsx, floating.tsx). The first time, it also adds the tokens and the cn() helper, imports the tokens in globals.css and installs clsx and tailwind-merge. Files already in your project are kept unless you add --force.
Import
Lives in src/design-system/components/agent-limits-card.tsx.
import { formatTokens, AgentLimitsCard } from "@/design-system/components/agent-limits-card";Usage
<AgentLimitsCard
context={{
max: 1_000_000,
segments: [
{ label: "Conversation", tokens: 312_000 },
{ label: "Studio files", tokens: 148_000 },
{ label: "Connected apps (deferred)", tokens: 41_500, deferred: true },
],
groups: [{ label: "Connected apps", tokens: 105_500, items: [{ label: "Figma", tokens: 38_400 }] }],
}}
plan="Studio"
planHref="/settings/plan"
limits={[
{ label: "5-hour limit", used: 0.38, resets: "Resets in 2 hr 46 min" },
{ label: "Weekly · all drafts", used: 0.24, resets: "Resets Mon 9:00 AM" },
]}
/>Examples
Expanded
defaultExpanded opens the breakdown on mount. Deferred buckets are listed with a dash and left out of the bar and the total; each group (context.groups) opens on its own.
- Figma38.4k
- Google Drive29.9k
- Xero21.8k
- Slack15.4k
- Lumen Coffee rebrand brief.pdf61.2k
- Northwind proposal v3.docx47.3k
- 2026 rate card.xlsx39.5k
- Avesk tone of voice14.2k
- Client logo usage11.8k
- 5-hour limitResets in 2 hr 46 min38%
- Weekly · all draftsResets Mon 9:00 AM24%
- Weekly · proposalsResets Mon 9:00 AM12%
Near the limit
From 80% a limit bar turns yellow, from 95% red. footer holds the upgrade note and action.
- 5-hour limitResets in 18 min97%
- Weekly · all draftsResets Mon 9:00 AM84%
- Weekly · proposalsResets Mon 9:00 AM61%
You're close to the 5-hour limit. New drafts pause until it resets, or move to Studio Pro for 5× the room.
When to use
Use it when
- Showing how much of the assistant's context and plan limits a studio has used
- A usage panel in the assistant sidebar or the plan settings page
- Explaining why the assistant is slowing down or pausing drafts
Don’t use it when
- One number against a target, like invoices sent this month → Stat card
- A single setting picked on a range → Slider
- Live progress of a task the assistant is doing → Agent thinking
Rules
- Pass tokens as numbers; the card formats them (820k, 1M) and works out the percentages
- Mark buckets that load only when needed as deferred: they are listed, not counted
- Write reset times as people say them: "Resets in 2 hr 46 min", "Resets Mon 9:00 AM"
- Put an upgrade note and one primary Button in footer only when a limit is close
Properties
AgentLimitsCard
| Prop | Type | Default |
|---|---|---|
context * | { max: number; segments: AgentContextSegment[]; groups?: AgentContextGroup[] } | – |
limits * | { label: string; used: number; resets?: string }[] | – |
plan | string | – |
planHref | string | – |
defaultExpanded | boolean | false |
expanded | boolean | – |
onExpandedChange | (expanded: boolean) => void | – |
footer | ReactNode | – |
className | string | – |
AgentContextSegment
| Prop | Type | Default |
|---|---|---|
label * | string | – |
tokens * | number | – |
color | string | – |
deferred | boolean | false |
AgentContextGroup
| Prop | Type | Default |
|---|---|---|
label * | string | – |
tokens * | number | – |
items * | { label: string; tokens: number }[] | – |
* required
Accessibility
- Every bar is role="meter" with its value and a spoken text ("38% used. Resets in 2 hr 46 min")
- The context window row and each group are real buttons with aria-expanded and aria-controls
- Closed sections are inert, so keyboard focus never lands in hidden rows
- Deferred buckets say "not counted" to screen readers instead of the dash
- Opening and closing animate only under motion-safe