Education
Lesson Completion Card - Learning Progress
Monitor lesson completion rates and student learning progress. Track course progression and module completion.
Lesson Completion Card
The Lesson Completion Card displays lessons completed today with checkmarks and visual indicators for completion status.
Preview
Installation
npx shadcn@latest add https://vectormotion.vercel.app/registry/lesson-completion-card.jsonLesson Completion Card
'use client'import React from 'react';import { CheckCircle } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";import { ResponsiveContainer, RadialBarChart, RadialBar, Tooltip } from 'recharts';function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs));}interface CompletionData { name: string; count: number; fill: string; [key: string]: any;}interface LessonCompletionCardProps { className?: string; title?: string; subtitle?: string; completedCount?: string; statusLabel?: string; data?: CompletionData[];}const DEFAULT_DATA: CompletionData[] = [ { name: 'Completed', count: 4, fill: '#10b981' },];const DEFAULT_TITLE = "Lessons";const DEFAULT_SUBTITLE = "Daily Progress";const DEFAULT_COMPLETED_COUNT = "4/5";const DEFAULT_STATUS_LABEL = "Done";export const LessonCompletionCard: React.FC<LessonCompletionCardProps> = ({ className = "", title = DEFAULT_TITLE, subtitle = DEFAULT_SUBTITLE, completedCount = DEFAULT_COMPLETED_COUNT, statusLabel = DEFAULT_STATUS_LABEL, data = DEFAULT_DATA,}) => { return ( <motion.div initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.5, delay: 0.3 }} className={cn( "relative overflow-hidden rounded-2xl border border-border bg-card text-card-foreground shadow-sm transition-all hover:border-emerald-300 dark:hover:border-emerald-700 hover:shadow-md flex flex-col h-full", className )} > <div className="p-5 flex flex-col h-full relative z-10"> <div className="mb-4 flex items-start justify-between"> <div> <h3 className="font-bold text-lg text-foreground"> {title} </h3> <p className="text-sm text-muted-foreground font-medium"> {subtitle} </p> </div> <div className="rounded-xl bg-emerald-500/10 p-2.5 text-emerald-500 dark:text-emerald-400 flex items-center justify-center ring-1 ring-emerald-100 dark:ring-emerald-800"> <CheckCircle className="h-5 w-5" /> </div> </div> <div className="flex-1 w-full min-h-[120px] relative"> <ResponsiveContainer width="100%" height="100%"> <RadialBarChart cx="50%" cy="50%" innerRadius="70%" outerRadius="100%" barSize={10} data={data} startAngle={90} endAngle={-270} > <RadialBar background dataKey="count" cornerRadius={10} /> <Tooltip cursor={false} content={() => null} /> </RadialBarChart> </ResponsiveContainer> <div className="absolute inset-0 flex items-center justify-center pointer-events-none"> <div className="text-center"> <span className="text-2xl font-bold text-foreground">{completedCount}</span> <p className="text-[10px] text-muted-foreground uppercase tracking-wider">{statusLabel}</p> </div> </div> </div> </div> <div className="absolute -bottom-4 -right-4 z-0 opacity-5 pointer-events-none"> <CheckCircle className="w-32 h-32 text-emerald-500" /> </div> </motion.div> );};Usage
This component helps students track their daily lesson completion, providing motivation and progress visibility.
Prop
Type