VectorMotion
Education

Graduation Rate Card - Student Success

Monitor graduation rates and student completion. Track academic progress toward graduation goals.

Graduation Rate Card

The Graduation Rate Card displays projected graduation rates with year-over-year comparisons and class information.

Preview

Installation

npx shadcn@latest add https://www.vectormotion.dev/registry/graduation-rate-card.json
Graduation Rate Card
'use client'import React from 'react';import { TrendingUp } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";import { ResponsiveContainer, LineChart, Line, Tooltip, XAxis } from 'recharts';function cn(...inputs: ClassValue[]) {  return twMerge(clsx(inputs));}interface GraduationData {  year: string;  rate: number;  [key: string]: any;}interface GraduationRateCardProps {  className?: string;  title?: string;  subtitle?: string;  rateValue?: string;  rateTrend?: string;  data?: GraduationData[];}const DEFAULT_DATA: GraduationData[] = [  { year: '2020', rate: 92 },  { year: '2021', rate: 94 },  { year: '2022', rate: 95 },  { year: '2023', rate: 97 },  { year: '2024', rate: 98 },];const DEFAULT_TITLE = "Graduation";const DEFAULT_SUBTITLE = "Projected Rate";const DEFAULT_RATE_VALUE = "98%";const DEFAULT_RATE_TREND = "+1.2%";export const GraduationRateCard: React.FC<GraduationRateCardProps> = ({  className = "",  title = DEFAULT_TITLE,  subtitle = DEFAULT_SUBTITLE,  rateValue = DEFAULT_RATE_VALUE,  rateTrend = DEFAULT_RATE_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-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>            <div className="flex items-center gap-2 mt-1">              <span className="text-2xl font-bold text-foreground">{rateValue}</span>              <span className="text-xs font-medium text-emerald-500 bg-emerald-500/10 px-1.5 py-0.5 rounded-full">                {rateTrend}              </span>            </div>            <p className="text-sm text-muted-foreground mt-1">              {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">            <TrendingUp className="h-5 w-5" />          </div>        </div>        <div className="flex-1 w-full min-h-[100px]">          <ResponsiveContainer width="100%" height="100%">            <LineChart data={data}>              <XAxis                dataKey="year"                axisLine={false}                tickLine={false}                tick={{ fontSize: 10, fill: '#71717a' }}              />              <Tooltip cursor={false} content={() => null} />              <Line                type="monotone"                dataKey="rate"                stroke="#10b981"                strokeWidth={2}                dot={{ r: 4, fill: '#10b981', strokeWidth: 0 }}                activeDot={{ r: 6, strokeWidth: 0 }}              />            </LineChart>          </ResponsiveContainer>        </div>        <div className="absolute -bottom-4 -right-4 z-0 opacity-5 pointer-events-none">          <TrendingUp className="w-32 h-32 text-emerald-500" />        </div>      </div>    </motion.div>  );};

Usage

This component helps administrators track graduation rates and monitor institutional success metrics over time.

Prop

Type

On this page

Free block

Need this in production?

Unlock install commands, source access, commercial use, and AI prompts for all VectorMotion blocks.