Skip to content

Horizontal milestone rail

A roadmap that scrolls sideways rather than wrapping.

Contentstartertimelineroadmaphorizontalscroll

Live preview

full widthLive preview — open it in a new tab for the full-height version.
Open the preview in a new tab

Source

This exact file renders the preview above.

import { Container } from '@/components/ui/layout'
import { Badge } from '@/components/ui/badge'

/**
 * Horizontal milestone rail
 *
 * A roadmap that scrolls sideways rather than wrapping, so the sequence stays
 * legible on any width. The scroll container is keyboard reachable because its
 * contents are focusable, and each milestone carries its status as a word.
 */
const milestones = [
  {
    period: 'Q1 2026',
    title: 'Foundry 1.0',
    status: 'Shipped',
    tone: 'success' as const,
    body: 'Four composition levels, five palettes, three densities.',
  },
  {
    period: 'Q2 2026',
    title: 'Motion tokens',
    status: 'In progress',
    tone: 'accent' as const,
    body: 'A named set of transitions, with reduced-motion equivalents.',
  },
  {
    period: 'Q3 2026',
    title: 'Data visualisation',
    status: 'Planned',
    tone: 'neutral' as const,
    body: 'Chart primitives built on the same token system.',
  },
  {
    period: 'Q4 2026',
    title: 'Localisation',
    status: 'Planned',
    tone: 'neutral' as const,
    body: 'Right-to-left layout and locale-aware formatting throughout.',
  },
  {
    period: '2027',
    title: 'Design tool export',
    status: 'Exploring',
    tone: 'warning' as const,
    body: 'Token export to design-tool variables, kept in sync by CI.',
  },
]

export default function HorizontalMilestonesTimeline() {
  return (
    <section className="border-b border-line bg-surface-sunken py-section">
      <Container>
        <div className="max-w-2xl">
          <h2 className="display-type text-2xl font-semibold text-ink-strong sm:text-3xl">
            What is next
          </h2>
          <p className="mt-3 text-md text-ink-muted">
            A fictional roadmap. Status is a word, not a colour.
          </p>
        </div>
      </Container>

      <div className="thin-scrollbar mt-10 overflow-x-auto pb-4">
        <ol className="flex min-w-max gap-4 px-4 sm:px-6 lg:px-8">
          {milestones.map((milestone) => (
            <li
              key={milestone.title}
              className="flex w-72 shrink-0 flex-col rounded-xl border border-line bg-surface p-5"
            >
              <div className="flex items-center justify-between gap-3">
                <span className="label-caps text-ink-subtle">{milestone.period}</span>
                <Badge size="sm" tone={milestone.tone}>
                  {milestone.status}
                </Badge>
              </div>
              <h3 className="mt-3 text-md font-semibold text-ink-strong">{milestone.title}</h3>
              <p className="mt-2 text-sm leading-relaxed text-ink-muted">{milestone.body}</p>
            </li>
          ))}
        </ol>
      </div>
    </section>
  )
}

components/blocks/sections/timeline/horizontal-milestones.tsx

import { Container } from '@/components/ui/layout'
import { Badge } from '@/components/ui/badge'

/**
 * Horizontal milestone rail
 *
 * A roadmap that scrolls sideways rather than wrapping, so the sequence stays
 * legible on any width. The scroll container is keyboard reachable because its
 * contents are focusable, and each milestone carries its status as a word.
 */
const milestones = [
  {
    period: 'Q1 2026',
    title: 'Foundry 1.0',
    status: 'Shipped',
    tone: 'success' as const,
    body: 'Four composition levels, five palettes, three densities.',
  },
  {
    period: 'Q2 2026',
    title: 'Motion tokens',
    status: 'In progress',
    tone: 'accent' as const,
    body: 'A named set of transitions, with reduced-motion equivalents.',
  },
  {
    period: 'Q3 2026',
    title: 'Data visualisation',
    status: 'Planned',
    tone: 'neutral' as const,
    body: 'Chart primitives built on the same token system.',
  },
  {
    period: 'Q4 2026',
    title: 'Localisation',
    status: 'Planned',
    tone: 'neutral' as const,
    body: 'Right-to-left layout and locale-aware formatting throughout.',
  },
  {
    period: '2027',
    title: 'Design tool export',
    status: 'Exploring',
    tone: 'warning' as const,
    body: 'Token export to design-tool variables, kept in sync by CI.',
  },
]

export default function HorizontalMilestonesTimeline() {
  return (
    <section className="border-b border-line bg-surface-sunken py-section">
      <Container>
        <div className="max-w-2xl">
          <h2 className="display-type text-2xl font-semibold text-ink-strong sm:text-3xl">
            What is next
          </h2>
          <p className="mt-3 text-md text-ink-muted">
            A fictional roadmap. Status is a word, not a colour.
          </p>
        </div>
      </Container>

      <div className="thin-scrollbar mt-10 overflow-x-auto pb-4">
        <ol className="flex min-w-max gap-4 px-4 sm:px-6 lg:px-8">
          {milestones.map((milestone) => (
            <li
              key={milestone.title}
              className="flex w-72 shrink-0 flex-col rounded-xl border border-line bg-surface p-5"
            >
              <div className="flex items-center justify-between gap-3">
                <span className="label-caps text-ink-subtle">{milestone.period}</span>
                <Badge size="sm" tone={milestone.tone}>
                  {milestone.status}
                </Badge>
              </div>
              <h3 className="mt-3 text-md font-semibold text-ink-strong">{milestone.title}</h3>
              <p className="mt-2 text-sm leading-relaxed text-ink-muted">{milestone.body}</p>
            </li>
          ))}
        </ol>
      </div>
    </section>
  )
}

components/ui/badge.tsx

import type { HTMLAttributes, ReactNode } from 'react'
import { variants } from '@/lib/variants'

/**
 * Badge
 *
 * A compact, non-interactive label. Tones map to the status token trios, and
 * because a badge is often the only signal in a dense table, the `dot` option
 * exists to add a second, colour-independent cue alongside the text.
 */
const badgeVariants = variants('inline-flex items-center gap-1.5 whitespace-nowrap font-medium', {
  variants: {
    tone: {
      neutral: 'bg-surface-sunken text-ink-muted border-line',
      accent: 'bg-accent-soft text-accent-soft-ink border-accent-line',
      success: 'bg-success-soft text-success border-success-line',
      warning: 'bg-warning-soft text-warning border-warning-line',
      danger: 'bg-danger-soft text-danger border-danger-line',
      info: 'bg-info-soft text-info border-info-line',
      inverse: 'bg-surface-inverse text-ink-inverse border-transparent',
    },
    appearance: {
      soft: 'border',
      outline: 'border bg-transparent',
      solid: 'border border-transparent',
    },
    size: {
      sm: 'h-4.5 rounded-sm px-1.5 text-2xs',
      md: 'h-5.5 rounded-sm px-2 text-xs',
    },
  },
  defaultVariants: { tone: 'neutral', appearance: 'soft', size: 'md' },
  compound: [
    { appearance: 'solid', tone: 'accent', class: 'bg-accent text-accent-ink' },
    { appearance: 'solid', tone: 'success', class: 'bg-success text-white' },
    { appearance: 'solid', tone: 'warning', class: 'bg-warning text-white' },
    { appearance: 'solid', tone: 'danger', class: 'bg-danger text-white' },
    { appearance: 'solid', tone: 'info', class: 'bg-info text-white' },
    { appearance: 'solid', tone: 'neutral', class: 'bg-ink text-ink-inverse' },
    { appearance: 'outline', tone: 'neutral', class: 'text-ink-muted' },
  ],
})

export type BadgeTone = 'neutral' | 'accent' | 'success' | 'warning' | 'danger' | 'info' | 'inverse'

export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
  tone?: BadgeTone
  appearance?: 'soft' | 'outline' | 'solid'
  size?: 'sm' | 'md'
  /** Adds a leading dot so the badge does not rely on hue alone. */
  dot?: boolean
  icon?: ReactNode
}

export function Badge({
  tone = 'neutral',
  appearance = 'soft',
  size = 'md',
  dot = false,
  icon,
  className,
  children,
  ...props
}: BadgeProps) {
  return (
    <span className={badgeVariants({ tone, appearance, size, className })} {...props}>
      {dot ? (
        <span className="size-1.5 shrink-0 rounded-full bg-current" aria-hidden="true" />
      ) : null}
      {icon}
      {children}
    </span>
  )
}

Demo source — adapt to your project. Foundry is not published as a package.

Usage

Scrolling keeps the sequence legible at any width. Each milestone carries its status as a word, so 'exploring' and 'shipped' are never distinguished by colour alone.

  • Include an 'exploring' item; a roadmap of certainties is a plan nobody believes.
  • The rail must scroll, not clip — test at 390px before shipping.

Variants and states

Every entry below is a genuine difference in behaviour or layout, and every one of them is visible in the preview above.

  • Five milestones
  • Horizontal scroll
  • Status badges

Accessibility

Keyboard reachable
The rail's contents are focusable, so it can be scrolled without a pointer.
Status in words
Every badge says its state.

Foundry implements published ARIA patterns and is tested against them. No WCAG certification is claimed — see the accessibility documentation for what is and is not covered.