crucıble

Quota

A context-window / credits meter card: rolling digit headline over one segmented bar that splits usage by category, each slice springing to its width independently. Past the warn threshold the leading edge breathes an amber glow; past critical the headline turns amber and a note fades in. Optional cost line and reset countdown.

motionfree

Installation

CLI

npx shadcn@latest add @crucible/quota

Manual — install dependencies, then copy the source

npm install motion

Props

PropTypeDefaultDescription
segmentsQuotaSegment[]Consumed usage by category, left to right. Used = the sum of all values; the remainder up to limit is shown as an automatic "Free" entry. Pass new arrays to update — each slice springs to its new width independently.
limitnumberCapacity the meter reads full at (e.g. a 200k-token context window).
unitstring"tokens"Unit noun appended to the headline and aria text.
formatQuotaFormat"compact""compact" → 84.2k, "full" → 84,200, or a custom formatter.
warnAtnumber0.8Fraction of limit (0–1) past which the bar's leading edge pulses with an accent→amber glow.
critAtnumber0.95Fraction of limit (0–1) past which the headline turns amber and note fades in.
costnumber | stringOptional cost line. A number renders as "$0.42 this session"; a string renders verbatim.
resetAtDate | numberWhen the quota resets (Date or epoch ms). Renders "Resets in 2h 14m", computed after mount (hydration-safe).
notestring"Compacting soon"Text of the critical-threshold note.
labelstring"Context window"Card heading.
freeLabelstring | null"Free"Legend label for the unused remainder; pass null to hide that entry.
accentColorstring"#a78bfa" (ion violet)The single accent hue: focus/edge glow and the default segment tints.
warnColorstring"#fbbf24"Warning/critical hue used by the glow tail, headline and note.
Also accepts all props of Omit<React.ComponentPropsWithoutRef<"div">, "children"> — they pass through to the underlying element.

Honors prefers-reduced-motion with a designed static fallback, and passes className through.