Xzero UI
Pro library

Slot text

Text and numbers that spin into their new value on staggered slot machine reels.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui/slot-text
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui/slot-text

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { SlotText } from "@/components/xzero/slot-text/slot-text";

<SlotText value={revenue} format={value => `$${value.toLocaleString("en-US")}`} announce />

<SlotText value={live ? "Live now" : "Soon"} spins={2} />

API reference

SlotText

Text or a number where every character is a reel. On change, digits count through the wheel in the direction the number moved, letters shuffle through the alphabet, and reels land left to right without overshoot.

PropTypeDefaultDescription
value (required)string | number–The value to show. Numbers pass through format.
format(value: number) => string–Formats number values. Defaults to en-US grouping (12,480).
durationnumber0.9Seconds the first reel spins.
staggernumber0.07Seconds between reels stopping, left to right.
spinsnumber1Extra full turns before landing. 0 rolls straight to the new digit.
align"start" | "end"–Which end reels are matched from when the length changes. Numbers default to end, strings to start.
announcebooleanfalseAnnounces new values politely to screen readers.
classNamestring–Extra class on the root. Font size and color come from the parent.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in type

Guidance for AI tools

Slot text: Text and numbers that spin into their new value on staggered slot machine reels. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components