TidalUI

Context meter preview

Inspect supplied token usage, response reserve and remaining context capacity.

pro · Data · composite

When to use

Alternatives

Configure components.json and the @tidal-pro namespace before installing Pro components.

Installation

npx shadcn@latest add @tidal-pro/context-meter

Import components/ui/tidal.css, components/ui/context-meter.css. Wrap installed components in tidal-scope.

Preview

Context meter component preview

Open interactive preview

Minimal example

import"./components/ui/tidal.css";
import"./components/ui/context-meter.css";
import{TidalContextMeter}from"./components/ui/context-meter";
export default()=><div className="tidal-scope"><TidalContextMeter capacity={1} used={1}/></div>;

API and props

TidalContextMeter.capacity (required)
number

Required capacity value accepted by this exported component.

TidalContextMeter.used (required)
number | null

Required used value accepted by this exported component.

TidalContextMeter.breakdown
ReadonlyArray<TidalContextPart> | undefined

Optional breakdown value accepted by this exported component.

TidalContextMeter.description
ReactNode

Optional description value accepted by this exported component.

TidalContextMeter.formatTokens
((tokens: number) => string) | undefined

Optional format tokens value accepted by this exported component.

TidalContextMeter.headingLevel
"h2" | "h3" | "h4" | "h5" | "h6" | undefined

Optional heading level value accepted by this exported component.

TidalContextMeter.labels
Partial<{ used: string; limit: string; reserve: string; remaining: string; unknown: string; unavailable: string; invalid: string; breakdown: string; unattributed: string; available: string; nearLimit: string; overLimit: string; exceeded: (tokens: string) => string; measurement: (used: string, capacity: string) => string; }> | undefined

Optional labels value accepted by this exported component.

TidalContextMeter.meterRef
Ref<HTMLMeterElement> | undefined

Optional meter ref value accepted by this exported component.

TidalContextMeter.reserved
number | undefined

Optional reserved value accepted by this exported component.

TidalContextMeter.title
ReactNode

Optional title value accepted by this exported component.

TidalContextMeter.warningRatio
number | undefined

Optional warning ratio value accepted by this exported component.

Complete usage

Full example, stylesheet imports, API and accessibility documentation

Gotchas