VexellDocs · v1.5

AI primitive

TokenMeter

Compact progress bar showing tokens used / max with color thresholds. Slots into ChatComposer or stands alone next to a model picker.

Usage

Pick your edition with the tabs. Selection syncs across all docs.

tsx
import { TokenMeter } from '@/components/molecules'

<TokenMeter used={2480} max={8000} />

Props

Same surface in both editions; HTML version exposes equivalents through Alpine x-data.

PropTypeDefaultDescription
usednumber0Tokens currently consumed.
maxnumberMaximum context size.
warningThresholdnumber0.75Switch to warning color past this fraction.
dangerThresholdnumber0.95Switch to danger color past this fraction.

Accessibility

  • role

    Renders as a <progress> element with aria-label.

  • contrast

    Used/max numbers tabular-nums in WCAG AA pairs.

Read next