Education
Alumni Donations Card - Fundraising Dashboard
Track alumni fundraising progress and donation goals. Monitor year-to-date fundraising and donor engagement metrics.
Alumni Donations Card
The Alumni Donations Card displays fundraising progress, showing total raised year-to-date and progress toward annual goals.
Preview
Installation
npx shadcn@latest add https://vectormotion.vercel.app/registry/alumni-donations-card.jsonAlumni Donations Card
'use client'import React from 'react';import { Heart } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";import { ResponsiveContainer, AreaChart, Area, XAxis, Tooltip } from 'recharts';function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs));}interface DonationData { month: string; amount: number; [key: string]: any;}interface AlumniDonationsCardProps { className?: string; title?: string; subtitle?: string; totalDonation?: string; trend?: string; data?: DonationData[];}const DEFAULT_DATA: DonationData[] = [ { month: 'Jan', amount: 12000 }, { month: 'Feb', amount: 19000 }, { month: 'Mar', amount: 15000 }, { month: 'Apr', amount: 25000 }, { month: 'May', amount: 32000 }, { month: 'Jun', amount: 28000 }, { month: 'Jul', amount: 45000 },];const DEFAULT_TITLE = "Fundraising";const DEFAULT_SUBTITLE = "Alumni Donations YTD";const DEFAULT_TOTAL_DONATION = "$176k";const DEFAULT_TREND = "+12%";export const AlumniDonationsCard: React.FC<AlumniDonationsCardProps> = ({ className = "", title = DEFAULT_TITLE, subtitle = DEFAULT_SUBTITLE, totalDonation = DEFAULT_TOTAL_DONATION, trend = DEFAULT_TREND, data = DEFAULT_DATA,}) => { return ( <motion.div initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.5, delay: 0.1 }} 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> <div className="flex items-center gap-2 mt-1"> <span className="text-2xl font-bold text-foreground">{totalDonation}</span> <span className="text-xs font-medium text-emerald-500 bg-emerald-500/10 px-1.5 py-0.5 rounded-full"> {trend} </span> </div> <p className="text-sm text-muted-foreground mt-1"> {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"> <Heart className="h-5 w-5" /> </div> </div> <div className="flex-1 w-full min-h-[100px]"> <ResponsiveContainer width="100%" height="100%"> <AreaChart data={data}> <defs> <linearGradient id="donationGradient" x1="0" y1="0" x2="0" y2="1"> <stop offset="5%" stopColor="#ec4899" stopOpacity={0.3} /> <stop offset="95%" stopColor="#ec4899" stopOpacity={0} /> </linearGradient> </defs> <XAxis dataKey="month" axisLine={false} tickLine={false} tick={{ fontSize: 10, fill: '#71717a' }} tickMargin={8} /> <Tooltip cursor={false} content={() => null} /> <Area type="monotone" dataKey="amount" stroke="#ec4899" strokeWidth={2} fill="url(#donationGradient)" /> </AreaChart> </ResponsiveContainer> </div> <div className="absolute -bottom-4 -right-4 z-0 opacity-5 pointer-events-none"> <Heart className="w-32 h-32 text-pink-500" /> </div> </div> </motion.div> );};Usage
This component helps track alumni fundraising efforts and visualize progress toward financial goals for educational institutions.
Prop
Type