Slot text
A React component in Beamline's Content & display category, in the free sample.
Text and numbers that roll into their new value on reels, digit by digit from the right; other characters fade. Read as plain text by assistive tech.
Use it for
- A figure that changes now and then: a total, a price, a status word.
Not for
- Values changing several times a second (plain tabular text).
Anatomy
- isolated value root (content direction independent of page layout)
- reels
- sr-only value
States
- rest
- rolling up (the number rose: every reel turns up, through the wrap where it must)
- rolling down
- new column (rises in)
- lost column (1,284 → 488: the place narrows to nothing and fades as the reels turn, from the change itself, so nothing moves after the roll)
- RTL page (numeric order and content direction preserved)
Keyboard
- Not interactive
Motion
Reels roll over twice --pui-duration-considered (about 0.7 s) on --pui-ease-out-strong, one --pui-stagger-word apart from the aligned side; both follow the motion scale, and a caller's duration/stagger in ms is scaled the same way. A number that rises turns every reel up and one that falls turns them down (an odometer: 9 → 0 rising passes the wrap); text turns each reel the short way. The change is taken in the same render it arrives in, so the first change rolls too. Reduced motion swaps the value.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
value / format | string | number / (n) => string | — | value: Text or number shown on the animated reels. Required. format: Turns a number into its text: currency, thousands. |
duration / stagger / spins | number | — | duration: ms per reel. Default: twice the considered duration (about 0.7 s), following the motion scale. stagger: ms between reels, right to left. Default: the word stagger (about 30 ms), following the motion scale. spins: Extra full turns a changing digit makes. Default 0. |
align | "start" | "end" | — | Which side stays put when the length changes. Default end (numbers). |
announce | boolean | — | Read the new value aloud when it changes. Default false (most counters are glanceable). |
dir | "ltr" | "rtl" | "auto" | — | Content direction. Numbers stay LTR; other text resolves its own direction instead of inheriting page layout. |
style / ref | CSSProperties / native Ref | — | style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default. |
classNames | SlotTextClassNames | — | Classes for the named visual parts; no part overrides by default. |
value (required) | string | number | — | Text or number shown on the animated reels. Required. |
format | ((value: number) => string) | — | Turns a number into its text: currency, thousands. |
duration | number | — | ms per reel. Default: twice the considered duration (about 0.7 s), following the motion scale. |
stagger | number | — | ms between reels, right to left. Default: the word stagger (about 30 ms), following the motion scale. |
spins | number | — | Extra full turns a changing digit makes. Default 0. |
className | string | — | Classes on the documented visual root; no override by default. |
ref | Ref<HTMLSpanElement> | — | Receives the documented root element; no ref by default. |
style | CSSProperties | — | Inline styles on the documented visual root; no inline overrides by default. |
Used in
- Security
- Agent monitor
- Agent runs monitor
- AI agent workspace
- Analytics dashboard
- Asset packs
- Billing & invoices
- Services and hours
- Case workspace
- Change orders
- Client forms
- Condition checklist
- Conversation history
- Course dashboard
- Course home
- CRM pipeline
- Dashboard panels
- Document review
- Email automation
- Field conditions
- File manager
- Gift desk
- Goods receiving
- Grading desk
- Guest messages
- Helpdesk inbox
- AI image studio
- Invoices
- Knowledge base manager
- Market screener
- Meeting and call review
- Model playground
- Onboarding checklist
- Order history and fills
- Order ledger
- Orders admin
- Payroll approvals
- Payroll run
- Pipeline record
- Plan comparison
- Playbook check
- Portfolio overview
- Project board
- Projects
- Purchase orders
- Purchase request
- Question builder
- Report builder
- Report library
- Roles & permissions
- Sales dashboard
- Session replay
- Settings
- Shift briefing
- Slide presenter
- Social media scheduler
- Stage reports
- Submittal register
- AI support chat
- AI support console
- System pages
- Table service
- Team chat
- Team & members
- Telemetry explorer
- Training progress
- Versioned dashboard
- Versioned document
- Writing canvas
Dependencies
motion
Import
import { SlotText } from "@beamline/slot-text";
Get it
Slot text is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Slot text is included in the free MIT sample. Get Beamline · Connect your agent
More in Content & display
- Image compare: Two images in one frame with a divider: drag anywhere, or arrow keys on the handle; horizontal or vertical, with captions.
- Revision compare: Two revisions of a drawing on one camera: side by side, they pan and zoom together (a crosshair in one pane marks the point under the pointer in the…
- Live cursors: Who else is working on this, and where: over any shared surface, each person's pointer in the colour their name always gets, with a name flag, gliding…
- Document viewer: A PDF or a paged document read and marked up in place: page thumbnails beside it, zoom to the width, the page or a percentage, pages by keyboard, a…
- Video player: A video player on the native <video> element: title bar with an external link and close, centre play with ±10 s, scrub, time, volume, speed, captions…
- Lightbox: A full-screen image viewer: a thumbnail grows into it and shrinks back, arrows and ←/→ step through the set, Esc or a downward drag closes it.
- File diff: A change to one file as a unified diff: line numbers, tinted lines, only the changed words marked, long unchanged stretches folded; give rows or just…
- QR Code: A scannable code set as gradient dots with rounded finder rings and an optional centre mark; a new value ripples out from the centre.
- Data matrix: A DataMatrix (ECC 200, ISO/IEC 16022) any scanner reads: crisp square modules in SVG at any size, the smallest symbol that holds the value (10×10 to…
- Text reveal: A headline whose words rise into place once, the first time it scrolls into view; never repeats.
- Text morph: A short label that becomes its next state letter by letter: shared letters glide into place, new ones arrive, old ones leave.
- Code block: Code to read and copy: highlighted in the system's colours, numbered, marked lines, long files folded behind “Show all”.
- Inbox list: Conversations waiting for a person, triaged in place: sender, subject and the first words, time, unread weight, star, labels and attachments, grouped by…
- Comment thread: A discussion attached to something: replies, reactions, @mentions, editing and deleting your own, resolve that folds the thread.
- Timeline: What happened, newest first and grouped by day: people with avatars, systems with toned icons, relative times with the exact time on hover, details in…
- Description list: The details of one record as label and value pairs: beside each other or stacked, in as many columns as the room holds; a copy button arrives on the row…
- Text shimmer: Ongoing work said in words (“Thinking…”) with a calm band of light passing across them; stops when inactive.
- Logo Carousel: A wall of logos shown a few at a time: every few seconds the slots turn left to right, each logo leaving upward as the next rises in.
- Avatar group: A team in a small space: overlapping faces that name themselves on hover or focus, and “+N” naming the rest.
- Avatar: A person or account in a small space: a photo, or initials on the hue their name always gets; presence dot; circle for people, square for companies.
- Item: The generic list row: media, title, description, meta and trailing actions; becomes a link or button when interactive.
- Marker: A labelled point in a stream: a status event with an icon between messages, or a label such as "Today" between two hairlines.
- Credit: "Designed with Beamline" for a site's footer: the Beamline mark and a quiet line, or a small badge. With your partner code, each new customer's first…
- Badge: A short status, category or count label: six tones, an icon or a status dot, two sizes.
- Kbd: Keyboard keys as keycaps, for combinations and sequences (G then A); `mod` resolves to ⌘ or Ctrl per platform, symbols are spoken as words.