Skip to content
caliper ui pro docs

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.

Pro

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

terminal
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.

PropTypeDefaultDescription
text *string—
tokensstring[]—The tokens, if you have the real ones; they must join back into `text`.
defaultSplitbooleanfalseStarts split into tokens.

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.md

The index of every part is at /llms.txt.

More in Text motion