Loading component…
Loading component…
A two-line project summary that quietly unfolds on hover – a progress ring with one segment per subtask, a people filter and a status picker, all linked by hover
To reuse this local React demo, copy all files from the Code tab into the same folder, then import ProjectCard from ./project-card.
import { ProjectCard } from "@/components/ui/project-card";
export function OnboardingCard() {
return (
<ProjectCard
title="Onboarding flow"
tasks={[
{ id: "welcome", label: "Welcome screen", done: true, assignee: "Mara" },
{ id: "workspace", label: "Workspace setup", done: true, assignee: "Jonas" },
{ id: "invite", label: "Invite teammates", assignee: "Mara" },
]}
status="progress"
due="Oct 24"
members={[{ name: "Mara" }, { name: "Jonas" }]}
action={{ label: "Open", onClick: () => router.push("/projects/onboarding") }}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| title | string | Name of the project | |
| tasks | ProjectTask[] | { id, label, done?, assignee? } – one ring segment and one row each; assignee is a member's name | |
| onTasksChange | (tasks: ProjectTask[]) => void | Called with the full list after a tick. With it the card shows exactly what you pass; without it the ticks live inside the card | |
| status | string | first option | Id of the chosen status |
| statuses | ProjectOption[] | To do, In progress, In review, Done | { id, label, tone? } – tone is red, amber, green, blue, violet or gray and also picks the icon; icon replaces it |
| onStatusChange | (id: string) => void | Called with the picked status | |
| due | string | Ready-to-show due date, e.g. "Oct 24" – shown as "Due Oct 24" | |
| members | ProjectMember[] | { name, avatar? } – the avatars in the head; hovering one shows only that person's subtasks. Initials on a soft color without an image | |
| action | { label: string; onClick: () => void } | A button on the tray of the open card, e.g. Open | |
| hint | ReactNode | "2 left" / "All done" | The line on the tray while nothing is hovered |
| trigger | "hover" \| "click" | "hover" | Hover opens under the mouse; taps and the keyboard always toggle |
| open | boolean | Controlled open state | |
| defaultOpen | boolean | false | Starts open when uncontrolled |
| onOpenChange | (open: boolean) => void | Called when the card opens or closes | |
| className | string | Extra class on the root |
Fills its container up to 320px. Below 290px the date drops its word ("Oct 24") and the avatars move closer; a long title is cut with an ellipsis and nothing runs under the avatars
Touch screens: a tap opens, a tap outside closes, rows and options are taller and the assignee avatars are always visible
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"