DOCS
v0.4

AI Components / Context Window

Context Window

Token budget tracker with segmented bar showing context window usage by category. Warning states and cache indicators.

ai-viz v0.4.0

Playground

Examples

Token budget
<ai-context-window total="128000" cached="4200" style="max-width: 500px;"></ai-context-window>

Import

import { AiContextWindow } from '@cognivo/components';
// Or tree-shake: import '@cognivo/components/ai-context-window';

Per-component imports ship only that component (~8 kB gzip).

API Reference

PropTypeDefaultDescription
total number 128000 Max context tokens
segments {label, tokens, color?}[] Usage segments
cached number 0 Cached tokens (prompt caching)

Events

EventDetailDescription
ai-context-segment-click {label, tokens} Segment clicked