Skip to content

Milestone views

The track renders display data you supply. It does not fetch a roadmap, calculate dates or persist selection.

Horizontal track

Now
Next Quarter
6 Months
Today

Installation and props

Prepare milestone data

interface Milestone {
  id: string;
  name: string;
  emoji: string;
  colorHex: string;
  horizonLabel: string;
  horizonShort: string;
  targetDate: string | null;
  progress: {
    total: number;
    completed: number;
    inProgress: number;
    percentage: number;
  };
}

The installed file exports Milestone and MilestoneTrackViewProps. Pass milestones and optionally className. Keep ids unique and stable. Format dates, horizon labels and percentages before rendering; API records need mapping into this shape.

Use nonnegative counts, completed + inProgress no greater than total, and percentage between 0 and 100. The component does not validate or clamp all values. colorHex must be a six-digit hex color because alpha suffixes are appended. Check its contrast in both themes.

Behavior and limits

  • The track maintains one active id internally. Click the active milestone again to collapse its details. There is no controlled selection prop or selection callback.
  • Rows are native buttons with aria-expanded and visible focus states. Collapsed details are inert and hidden from assistive technology. Preserve those semantics when editing.
  • The track groups exact horizonShort values: "Now", "3mo" and "6mo". Milestones with other values are omitted.
  • Empty arrays render the layout without an empty-state message. Add loading, empty and error states around the component in your app.
  • The detail panel displays completed and total counts. Its expansion transition respects reduced-motion preferences.

See installation for prerequisites and theming for tokens. To manage milestones within Reflet rather than render your own view, read using Reflet.