Token split
Shows how a model reads a piece of text. Split it and the words come apart into tokens, each with its own tint, with leading spaces shown as a faint dot and the token count beside the characters.
Summarise the attached quarterly report in three bullet points, highlighting unexpected churn.
20tokens · 94 characters
When to use
- Prompt editors, playgrounds and cost estimators.
- Teaching what a token is.
When not to use
- Exact billing; pass your tokenizer's real output, or show counts from the API.
- Very long documents; split a paragraph at a time.
Installation
pnpm dlx shadcn@latest add @caliper/token-split
Adds its 3 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
API reference
TokenSplit
3 props
Also accepts the native props of its root element and a ref.
roughTokens
0 props
No props of its own; it accepts the native props of its root element.
Keyboard
- No custom key handling; Tab and the native activation keys do the work.
Accessibility
It is built on native elements and keeps aria-pressed in step with state.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/token-split.mdThe index of every part is at /llms.txt.