Themes
- Default
- Catppuccin
- Dracula
- High Contrast
- High Contrast Light
- Monokai
- Nord
- One Dark
- Solarized
- Tokyo Night
- AMOLED
- Aura
- Ayu
- Carbonfox
- Catppuccin Frappe
- Catppuccin Macchiato
- Cobalt2
- Cursor
- Everforest
- Flexoki
- GitHub
- Gruvbox
- Kanagawa
- Lucent Orng
- Material
- Matrix
- Mercury
- Night Owl
- OC-2
- One Dark Pro
- OpenCode
- Orng
- Osaka Jade
- Palenight
- Rose Pine
- Shades of Purple
- Synthwave '84
- Vercel
- Vesper
- Zenburn
Utility
AI
Terminal
token-usage-demo
No opentui live preview is registered for this example yet.
Installation
$ pnpm dlx shadcn@latest add @termcn/token-usage
Usage
import { TokenUsage, ContextMeter } from "@/components/ui/token-usage";<TokenUsage prompt={2450} completion={890} model="gpt-4o" showCost />API Reference
TokenUsage
| Prop | Type | Default |
|---|---|---|
prompt | number | required |
completion | number | required |
model | string | - |
showCost | boolean | false |
ContextMeter
| Prop | Type | Default |
|---|---|---|
used | number | required |
limit | number | required |
label | string | - |
showPercent | boolean | true |
warnAt | number | 75 |
criticalAt | number | 90 |
width | number | 20 |