About
A winding, Duolingo-style path of round lesson nodes for a course, showing finished lessons with a tick, the next lesson with a bobbing Start flag, and locked lessons greyed out, with a details card and XP reward on press.
Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Lesson Path to your project and fits it to your theme.
Code
How Lesson Path is used: the demo's code. The component's own source comes with a free account.
Usage.tsx
"use client";
import LessonPath from "@/components/ui/lesson-path";
import type { PathUnit } from "@/components/ui/lesson-path";
import { useState } from "react";
const UNITS: PathUnit[] = [
{
id: "u1",
title: "Getting around town",
subtitle: "Ask for directions, read signs",
color: "green",
lessons: [
{ id: "l1", title: "Greetings", xp: 10, state: "done" },
{ id: "l2", title: "At the market", xp: 10, state: "done" },
{ id: "l3", title: "Ordering coffee", xp: 15, state: "current" },
{ id: "l4", title: "Taking a taxi", xp: 15, state: "locked" },
{ id: "l5", title: "Unit review", xp: 20, state: "locked" },
],
},
{
id: "u2",
title: "Working days",
subtitle: "Meetings, emails and small talk",
color: "blue",
lessons: [
{ id: "l6", title: "Introductions", xp: 10, state: "locked" },
{ id: "l7", title: "Scheduling", xp: 15, state: "locked" },
],
},
];
export default function LessonPathDemo() {
const [started, setStarted] = useState("");
return (
<div className="flex min-h-full w-full justify-center bg-background px-4 py-10">
<div className="w-full max-w-[26rem]">
<LessonPath
units={UNITS}
theme="light"
onStart={(id) =>
setStarted(
UNITS.flatMap((u) => u.lessons).find((l) => l.id === id)?.title ??
"",
)
}
/>
<p
role="status"
className="mt-6 text-center text-[13px] font-bold text-muted-foreground"
>
{started
? `Demo · would open "${started}"`
: "Press a lesson to see what it holds."}
</p>
</div>
</div>
);
}
















