Education
Extracurricular Card - Student Activities
Track student participation in extracurricular activities. Monitor club membership and activity engagement.
Extra Curricular Card
The Extra Curricular Card displays student club participation and upcoming meeting information.
Preview
Installation
npx shadcn@latest add https://vectormotion.vercel.app/registry/extra-curricular-card.jsonExtra Curricular Card
'use client'import React from 'react';import { Palette } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";import { ResponsiveContainer, PieChart, Pie, Cell, Tooltip } from 'recharts';function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs));}interface ClubData { name: string; hours: number; color: string; [key: string]: any;}interface ExtraCurricularCardProps { className?: string; title?: string; subtitle?: string; data?: ClubData[];}const DEFAULT_DATA: ClubData[] = [ { name: 'Debate', hours: 5, color: '#f472b6' }, { name: 'Robotics', hours: 8, color: '#6366f1' }, { name: 'Chess', hours: 3, color: '#10b981' },];const DEFAULT_TITLE = "Clubs";const DEFAULT_SUBTITLE = "Weekly Hours";export const ExtraCurricularCard: React.FC<ExtraCurricularCardProps> = ({ className = "", title = DEFAULT_TITLE, subtitle = DEFAULT_SUBTITLE, data = DEFAULT_DATA,}) => { return ( <motion.div initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.5, delay: 0.2 }} className={cn( "relative overflow-hidden rounded-2xl border border-border bg-card text-card-foreground shadow-sm transition-all hover:border-pink-300 dark:hover:border-pink-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-pink-50 dark:bg-pink-900/20 p-2.5 text-pink-500 dark:text-pink-400 flex items-center justify-center ring-1 ring-pink-100 dark:ring-pink-800"> <Palette className="h-5 w-5" /> </div> </div> <div className="flex-1 w-full min-h-[120px] relative"> <ResponsiveContainer width="100%" height="100%"> <PieChart> <Pie data={data} innerRadius={30} outerRadius={50} paddingAngle={5} dataKey="hours" stroke="none" > {data.map((entry, index) => ( <Cell key={`cell-${index}`} fill={entry.color} /> ))} </Pie> <Tooltip cursor={false} content={() => null} /> </PieChart> </ResponsiveContainer> </div> <div className="absolute -bottom-4 -right-4 z-0 opacity-5 pointer-events-none"> <Palette className="w-32 h-32 text-pink-500" /> </div> </div> </motion.div> );};Usage
This component helps students and administrators track participation in extracurricular activities and club meetings.
Prop
Type