Live Ticker Stats
A stats section with a pulsing 'live' indicator near the heading and 2-3 stat numbers that periodically increment by a fixed amount to simulate a real-time feed. All increments and the tick interval are fixed props, not random or time-based, so builds stay deterministic.
Docs
Installation
A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its dependencies and any missing npm packages, and installs them straight into your project.
npx shadcn add https://staaarter.com/r/live-ticker-stats.jsonPrefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/stats/stats16.tsx instead.
Usage
The file also exports stats16Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.
import { Stats16, stats16Demo } from "@/components/blocks/stats/stats16"; export default function Page() { return <Stats16 {...stats16Demo} />; }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| liveLabel | string | "Live" | Text next to the pulsing dot indicator. |
| heading | string | none | Section heading. |
| description | string | undefined | Optional supporting sentence under the heading. |
| stats | TickerStat[] | none | Stats that tick up over time; each has its own fixed tick amount. |
| tickIntervalMs | number | 3000 | Milliseconds between each tick for every stat. |
| className | string | none | Extra classes for the outer section element. |
Types
type TickerStat = { label: string; initialValue: number; /** Fixed amount added to this stat on every tick interval. Never randomized. */ tickAmount: number; suffix?: string; };
Behavior notes
- This is a simulated live feed only: numbers tick up by each stat's fixed tickAmount every tickIntervalMs via a real setInterval started on mount, purely for visual effect, not connected to any real data source.
- Ticking never stops on its own while the block stays mounted; the interval is cleared on unmount to avoid a memory leak, but there is no cap or 'freeze after N ticks' behavior.
- Initial render always shows each stat's initialValue (identical on server and client) so there is no hydration mismatch; the first increment only happens after the first tickIntervalMs elapses client-side.
- All increments are fixed values from props, never Math.random() or Date.now()/new Date(), so repeated static renders (e.g. card thumbnails) start from the same numbers.
- The pulsing dot indicator (animate-pulse-style ping + solid dot, bg-primary) is purely decorative and does not reflect any real connection status.
More Stats Blocks
View all →Simple Four Stat Row
A plain 4-column row of big numbers with labels, no icons or chrome.
Stats With Icons
Bordered stat tiles, each topped with a lucide icon above the number.
Big Hero Stat
One dominant, oversized stat with smaller supporting stats below it.
Stats With Progress Bars
A vertical list of stats, each paired with a horizontal progress bar toward a goal.
Animated Counter Row
A 4-stat row whose numbers count up from 0 on mount.
Dashboard Style Grid
A dense analytics-dashboard grid with trend deltas and inline sparklines.