Skip to content
Sign upGet access
MicrointeractionsContext pourMenu

Context pour (Pro)

ProIncluded in $99

The context window as something that fills: a file's token cost flies into the meter and the part it added stays lit.

ProEach attached file pours its token cost into the meter; the part it added stays lit for a moment, the bar warns near the limit and turns red past it.

When a file or a pasted log is added, its token cost flies into the meter, the bar pours forward to the new total, and the part just added stays lit for a moment before it settles into the rest, so you can see what that one file cost. Past 80% the bar takes the amber of things near a limit; past the window it turns red and says what to do.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/context-pour

Needs chatcn Pro

This command works with a Pro license, along with every Pro component.

Or start free: sign up and get three Pro components on us, with a new one every month.

Usage

tsx
import { ContextPour, pourInto } from "@/components/ui/chatcn/pro/context-pour"

await pourInto(chipEl, meterRef.current, file.tokens)
setUsed((u) => u + file.tokens)

<ContextPour ref={meterRef} used={used} limit={200_000} />

Props

PropTypeNotes
usednumberTokens in context
limitnumberThe model's window
warnAtnumberShare where it warns. Default 0.8
labelstringDefault "Context"

Accessibility

  • role="meter" with the share in words; over the limit adds a status line that says how to fix it.

Motion

  • The fill is a heavy spring on scaleX; the fresh part glows in the accent and fades over 1.3 s.
  • Reduced motion: no flight and the bar jumps.