Skip to content
caliper ui docs

Pro

Slot text

Text whose characters roll like a slot machine when the value changes.

Pro
pnpm dlx shadcn@latest add @caliper/slot-text

web-checkout 4.12

Production deploy started by Ravi Patel at 14:05

Queued

Installs components/ui/slot-text.tsxDepends on none beyond ReactMotion honours reduced motion

When to use

Use it for

  • A short value such as a status or label changes and the change should be noticed.

Skip it when

  • The value changes many times a second.
  • The text is long.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/slot-text

Adds its 2 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.

Usage

Import it from your copy of the source. The example behind the preview comes with the source.

example.tsx
import { SlotText } from "@/components/ui/slot-text"

The worked example comes with Pro

The 35-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

SlotText

component
PropTypeDefaultDescription
items *readonly string[]—
index *number—
loopsnumber0Extra full turns before landing, for a livelier spin.
classNamestring—

Accessibility

It is built on native elements and keeps aria-hidden in step with state.

No custom key handling; Tab and the native activation keys do the work.

Motion

It checks prefers-reduced-motion itself and settles immediately instead of travelling. Every state is still reachable.

All Changing values examples