GitHub165

Milestone List

Vertical React milestone list with icons, descriptions, and optional progress for dense milestone UI. Complements grids and cards in progress dashboards and onboarding flows. Open source, built on shadcn/ui + Tailwind.

Milestone List is built for dense layouts where each row carries a title, supporting text, and progress—ideal for onboarding checklists, quest logs, and step-by-step activation flows.

10 Day Streak

Open app for 10 days

60%

5,000 Calorie Burn

Burn 5K calories total

32%

Weekend Warrior

Complete challenges on weekends

Installation

npx shadcn@latest add https://ui.trophy.so/milestone-list

Usage

import { MilestoneList } from "@/components/ui/milestone-list"
<MilestoneList
  milestones={[
    {
      id: "list-1",
      name: "10 Day Streak",
      description: "Open app for 10 days",
      trigger: "streak",
      achievedAt: "2024-01-01T00:00:00Z",
      progress: 60,
    },
    {
      id: "list-2",
      name: "5,000 Calorie Burn",
      description: "Burn 5K calories total",
      trigger: "metric",
      achievedAt: "2024-01-01T00:00:00Z",
      progress: 32,
    },
  ]}
/>

Examples

Basic Usage

10 Day Streak

Open app for 10 days

60%

5,000 Calorie Burn

Burn 5K calories total

32%

Weekend Warrior

Complete challenges on weekends

<MilestoneList
  milestones={[
    {
      id: "list-1",
      name: "10 Day Streak",
      description: "Open app for 10 days",
      trigger: "streak",
      achievedAt: "2024-01-01T00:00:00Z",
      progress: 60,
    },
    {
      id: "list-2",
      name: "5,000 Calorie Burn",
      description: "Burn 5K calories total",
      trigger: "metric",
      achievedAt: "2024-01-01T00:00:00Z",
      progress: 32,
    },
  ]}
/>

With Trophy

Use the Trophy SDK to fetch a user's milestones server-side. Milestones are served by Trophy's achievements API:

import { TrophyApiClient } from '@trophyso/node';

const trophy = new TrophyApiClient({
  apiKey: 'YOUR_API_KEY'
});

const response = await trophy.users.achievements("user-id");

Then pass the response into MilestoneList props in your UI layer:

<MilestoneList milestones={response} />

API Reference

Props

PropTypeDefaultDescription
milestonesUserMilestone[]RequiredArray of milestones to render in list rows
badgeSize"sm" | "default" | "lg""default"Size of badge in each row
lockedStyle"grayscale" | "silhouette" | "hidden""grayscale"Locked milestone visual treatment
onMilestoneClick(milestone) => void-Row click handler
columns2 | 3 | 4 | "auto""auto"Supported for compatibility with MilestoneGrid
gap"sm" | "default" | "lg""default"Vertical spacing between rows

Types

interface Milestone {
  id: string
  name: string
  description?: string | null
  trigger: "metric" | "api" | "streak"
  badgeUrl?: string | null
  progress?: number // optional, unlocked only
  rarity?: number // accepted but not rendered in list rows
}

interface UserMilestone extends Milestone {
  achievedAt: string | null
}