Ticker tape
A scrolling row of live metrics, each with its value and its signed change: prices, queue lengths, regional sign-ups. It suits a header or a status bar where figures are glanced at. For figures a reader compares, use a table; for logos and quotes, the plain marquee.
Install
npx shadcn@latest add @thrum-pro/ticker-tapeThis is a Pro component. The command works once your project has a licence key: set up Pro or see pricing.
Data shape
type TickerTapeItem = { id: string; label: string; value: number | null; change: number | null };[
{ id: "ACME", label: "ACME", value: 182.4, change: 0.021 },
{ id: "NWND", label: "NWND", value: 64.15, change: -0.008 },
{ id: "FERN", label: "FERN", value: null, change: null },
]Props
| Prop | Type | Default | Description |
|---|---|---|---|
items | readonly TickerTapeItem[] | Required | The metrics, in the order they pass. Keep each id while its value changes, so the item updates in place. |
label | string | Required | What the tape shows, for screen readers. It names the region. |
direction | "left" | "right" | Default "left" | Which way the tape travels. |
speed | number | Default 40 | Speed in pixels per second. |
gap | number | Default 16 | Space between items, in pixels. |
format | Intl.NumberFormatOptions | Default { notation: "compact", maximumFractionDigits: 2 } | How each value is written. |
changeFormat | Intl.NumberFormatOptions | Default signed percent, one decimal | How each change is written. The sign is always shown. |
locale | string | Default "en-US" | The locale for values and changes. |
emptyLabel | string | Default "No data" | Shown in place of the tape when there are no items. |
fade | boolean | Default true | Fade the tape out over the last 48 pixels at each end (trailing edge only while paused so the leading symbol stays crisp). |
pauseOnHover | boolean | Default true | Stop while the pointer is over the tape and while it has focus. |
paused | boolean | Default false | Freeze the tape where it is. |
sound | boolean | Default true | Play a subtle tick when metric values update, if the visitor has sound on. |
className | string | – | Extra classes, merged last. Set the width here. |
...props | ComponentProps<"div"> | – | Every other div attribute is passed through to the marquee root. |
Motion and sound
Motion
- The tape slides at a constant speed, 40 pixels a second by default, as the marquee does: the list and a copy of it end to end, so the seam never shows.
- A new value rolls from the old number to the new one, and the item lights up with the text colour at 10% and fades out over 700 ms. The change rolls in its badge.
- It stops while the pointer is over it and while it has keyboard focus. paused freezes it where it is.
- Reduced motion: the tape stands still, the copy is gone, and the items wrap onto as many lines as they need. Values change at once; the highlight still fades.
Sound
- A subtle tick when prices update in place. Nothing plays on initial mount.
Sound is off until the visitor turns it on. Pass sound={false} to keep this component silent. How sound works
Accessibility
- The tape is a region named by label, holding a list with one item per metric: "ACME $182.40 Up +2.1%". The moving copy is aria-hidden and inert, so the list is read once.
- It is not a live region: a screen reader is not interrupted each time a price moves. Read the list again to hear the latest values.
- Direction is never colour alone: each change carries an arrow of its own shape and a sign, and screen readers hear Up, Down or No change.
- A missing value or change prints a dash and is read as No data.
- Moving text that runs for more than 5 seconds needs a way to stop it: hover and focus stop the tape, and paused holds it still.
| Keys | Action |
|---|---|
| Tab | Focus the tape, which stops it until focus leaves. |
Source
The source comes with Pro
TypeScript source · Copy-paste ready · MIT-compatible for client projects · Includes all dependencies
Files and dependencies
- Adds
components/ui/ticker-tape.tsx- Packages
motion- Brings along
- MarqueeTrend badgeAnimated numberChart foundationsMotion tokensSound engine
Changelog
- 1.0.0 · 2026-12-03First release.