VectorMotion
Education

Attendance Tracker Card - Student Attendance

Monitor student attendance records and participation. Track attendance trends and identify chronic absenteeism.

Attendance Tracker Card

The Attendance Tracker Card displays current semester attendance percentage with a visual circular progress indicator and attendance streak information.

Preview

Installation

npx shadcn@latest add https://www.vectormotion.dev/registry/attendance-tracker-card.json
Attendance Tracker Card
'use client'import React from 'react';import { UserCheck } 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 AttendanceData {  day: string;  present: number;  [key: string]: any;}interface AttendanceTrackerCardProps {  className?: string;  title?: string;  average?: string;  averageLabel?: string;  subtitle?: string;  data?: AttendanceData[];}const DEFAULT_DATA: AttendanceData[] = [  { day: 'Mon', present: 95 },  { day: 'Tue', present: 92 },  { day: 'Wed', present: 96 },  { day: 'Thu', present: 94 },  { day: 'Fri', present: 98 },];const DEFAULT_TITLE = "Attendance";const DEFAULT_AVERAGE = "96%";const DEFAULT_AVERAGE_LABEL = "Avg";const DEFAULT_SUBTITLE = "Weekly Trend";export const AttendanceTrackerCard: React.FC<AttendanceTrackerCardProps> = ({  className = "",  title = DEFAULT_TITLE,  average = DEFAULT_AVERAGE,  averageLabel = DEFAULT_AVERAGE_LABEL,  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-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">{average}</span>              <span className="text-xs font-medium text-emerald-500 bg-emerald-500/10 px-1.5 py-0.5 rounded-full">                {averageLabel}              </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">            <UserCheck 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="attendanceGradient" x1="0" y1="0" x2="0" y2="1">                  <stop offset="5%" stopColor="#10b981" stopOpacity={0.3} />                  <stop offset="95%" stopColor="#10b981" stopOpacity={0} />                </linearGradient>              </defs>              <XAxis                dataKey="day"                axisLine={false}                tickLine={false}                tick={{ fontSize: 10, fill: '#71717a' }}                tickMargin={8}              />              <Tooltip cursor={false} content={() => null} />              <Area                type="monotone"                dataKey="present"                stroke="#10b981"                strokeWidth={2}                fill="url(#attendanceGradient)"              />            </AreaChart>          </ResponsiveContainer>        </div>      </div>      <div className="absolute -bottom-4 -right-4 z-0 opacity-5 pointer-events-none">        <UserCheck className="w-32 h-32 text-emerald-500" />      </div>    </motion.div>  );};

Usage

This component provides a clear visual representation of attendance metrics, helping track student presence and identify attendance patterns.

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.