Yearly Goals Progress Card
Goals progress card: yearly goals each with a progress bar, an expected-by-today pace marker, owner names, and met, on-pace or behind-pace status lines. A dashboard card for tracking targets.
import { CheckCircleIcon, WarningCircleIcon } from "@phosphor-icons/react/ssr"
import {
Card,
CardAction,
CardContent,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card"
import {
Progress,
ProgressLabel,
ProgressValue,
} from "@/components/ui/progress"
// The copy: change text here, not in the markup.
const COPY = {
title: "2026 goals",
description: (day: number, days: number, percent: number) =>
`Day ${day} of ${days}, ${percent}% of the year`,
pace: "Expected by today",
of: "of",
owner: "owner",
onPace: "On pace",
met: "Met",
behind: (left: number, weeks: number) =>
`Behind pace: ${left} to go in ${weeks} weeks`,
} as const
// Demo snapshot: October 26, 2026, day 299 of 365.
const YEAR = { day: 299, days: 365 }
type Goal = {
name: string
done: number
target: number
owner: string
met?: { label: string; date: string }
}
const GOALS: Goal[] = [
{
name: "New paid workspaces",
done: 412,
target: 500,
owner: "Pamela Melroy",
},
{
name: "Annual plan upgrades",
done: 120,
target: 120,
owner: "Alexei Leonov",
met: { label: "Oct 19", date: "2026-10-19" },
},
{ name: "Partner countries", done: 9, target: 15, owner: "Megan McArthur" },
{ name: "Guides rewritten", done: 34, target: 40, owner: "Raja Chari" },
]
// A goal is on pace when its share done has kept up with the share of the
// year gone; the mark on each open bar sits at that share.
export default function GoalsPaceCard() {
const pace = YEAR.day / YEAR.days
const weeksLeft = Math.floor((YEAR.days - YEAR.day) / 7)
return (
<Card className="mx-auto w-full max-w-md">
<CardHeader>
<CardTitle>
<h2>{COPY.title}</h2>
</CardTitle>
<CardDescription>
{COPY.description(YEAR.day, YEAR.days, Math.round(pace * 100))}
</CardDescription>
<CardAction>
<p className="flex min-h-6 flex-wrap items-center gap-1.5 text-xs text-pretty text-muted-foreground">
<span
aria-hidden="true"
className="h-3.5 w-0.5 shrink-0 rounded-full bg-foreground"
/>
{COPY.pace}
</p>
</CardAction>
</CardHeader>
<CardContent>
<ul className="grid gap-6">
{GOALS.map((goal) => {
const onPace = goal.done / goal.target >= pace
return (
<li key={goal.name} className="grid gap-3">
<Progress
value={goal.done}
max={goal.target}
locale="en-US"
className="relative"
>
<ProgressLabel>{goal.name}</ProgressLabel>
<ProgressValue />
{goal.met ? null : (
<span
aria-hidden="true"
className="pointer-events-none absolute -bottom-1 z-10 h-5 w-0.5 -translate-x-1/2 rounded-full bg-foreground ring-2 ring-card"
style={{ left: `${pace * 100}%` }}
/>
)}
</Progress>
<div className="flex flex-wrap items-center justify-between gap-x-4 gap-y-1 text-xs text-muted-foreground">
<p>
<span className="tabular-nums">
{goal.done} {COPY.of} {goal.target}
</span>
<span aria-hidden="true"> · </span>
<span className="sr-only">, {COPY.owner} </span>
{goal.owner}
</p>
{goal.met ? (
<p className="flex items-center gap-1 text-foreground">
<CheckCircleIcon
weight="fill"
aria-hidden="true"
className="size-3.5 shrink-0"
/>
<span>
{COPY.met}{" "}
<time dateTime={goal.met.date}>{goal.met.label}</time>
</span>
</p>
) : onPace ? (
<p>{COPY.onPace}</p>
) : (
<p className="flex items-center gap-1 text-destructive">
<WarningCircleIcon
weight="fill"
aria-hidden="true"
className="size-3.5 shrink-0"
/>
<span>
{COPY.behind(goal.target - goal.done, weeksLeft)}
</span>
</p>
)}
</div>
</li>
)
})}
</ul>
</CardContent>
</Card>
)
}
Installation
npx shadcn@latest add @01orbital/goals-pace-cardMake it yours
- Its words are in
COPYat the top ofcomponents/blocks/metrics/goals-pace-card/index.tsx: change them there, not in the markup. YEARandGOALS, also at the top of the file, hold its lists and settings.
Built from
npm: @phosphor-icons/react. The CLI installs it for you.
Built from these parts. The CLI adds each one that is missing and won't replace a file you already have unless you choose to:
The shadcn parts here are their Base UI versions, and this piece uses Base UI's API. A Radix version you already have won't work with it.
Last updated on