Staaarter

Milestone Timeline Stats

Timeline section listing a handful of milestones (a date, a short headline, and an associated stat) connected by a line. Renders as a horizontal row with a connecting line on desktop and collapses to a vertical, left-aligned list with a connecting line on mobile.

By Staaarter Team
Stats
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its badge dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/milestone-timeline-stats.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/stats/stats9.tsx instead.

Usage

The file also exports stats9Demo, 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 { Stats9, stats9Demo } from "@/components/blocks/stats/stats9";

export default function Page() {
  return <Stats9 {...stats9Demo} />;
}

Props

PropTypeDefaultDescription
badge{ label: string; variant?: BadgeVariant }nonePill above the heading; only rendered when badge is truthy.
headingstringundefinedSection heading.
descriptionstringundefinedSection intro text.
milestonesMilestone[]noneOrdered list of milestones rendered along the timeline.
classNamestringnoneExtra classes for the outer section element.

Types

type Milestone = {
  date: string;
  headline: string;
  stat: string;
};

Behavior notes

  • Two separate markup blocks are rendered for the timeline (one vertical list shown only below the sm breakpoint, one horizontal row shown only at sm and above); only one is visible at a time via Tailwind's responsive display utilities, there is no JS-driven layout switching.
  • The connecting line is a plain absolutely-positioned div (a 1px bg-border bar), not an SVG path.
  • milestones renders in whatever order the array is given; there is no date parsing or automatic sorting.