Vector Motion
Education

Online Class Status Card - Distance Learning

Monitor online class attendance and participation. Track virtual learning engagement and course delivery.

Online Class Status Card

The Online Class Status Card displays information about currently active online classes with join functionality.

Preview

Installation

npx shadcn@latest add https://vectormotion.vercel.app/registry/online-class-status-card.json
Online Class Status Card
'use client'import React from 'react';import { Radio } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";import { ResponsiveContainer, AreaChart, Area, Tooltip } from 'recharts';function cn(...inputs: ClassValue[]) {  return twMerge(clsx(inputs));}interface ClassStatusData {  time: string;  quality: number;  [key: string]: any;}interface OnlineClassStatusCardProps {  className?: string;  title?: string;  subtitle?: string;  statusLabel?: string;  data?: ClassStatusData[];}const DEFAULT_DATA: ClassStatusData[] = [  { time: '0m', quality: 90 },  { time: '5m', quality: 95 },  { time: '10m', quality: 85 },  { time: '15m', quality: 92 },  { time: '20m', quality: 98 },  { time: '25m', quality: 100 },];const DEFAULT_TITLE = "Live Class";const DEFAULT_SUBTITLE = "Virtual Room";const DEFAULT_STATUS_LABEL = "LIVE";export const OnlineClassStatusCard: React.FC<OnlineClassStatusCardProps> = ({  className = "",  title = DEFAULT_TITLE,  subtitle = DEFAULT_SUBTITLE,  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.2 }}      className={cn(        "relative overflow-hidden rounded-2xl border border-border bg-card text-card-foreground shadow-sm transition-all hover:border-red-300 dark:hover:border-red-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-red-50 dark:bg-red-900/20 p-2.5 text-red-500 dark:text-red-400 flex items-center justify-center ring-1 ring-red-100 dark:ring-red-800">            <div className="relative">              <Radio className="h-5 w-5" />              <span className="absolute -top-1 -right-1 flex h-2.5 w-2.5">                <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75"></span>                <span className="relative inline-flex rounded-full h-2.5 w-2.5 bg-red-500"></span>              </span>            </div>          </div>        </div>        <div className="flex-1 w-full min-h-[100px] relative">          <ResponsiveContainer width="100%" height="100%">            <AreaChart data={data}>              <defs>                <linearGradient id="qualityGradient" x1="0" y1="0" x2="0" y2="1">                  <stop offset="5%" stopColor="#ef4444" stopOpacity={0.3} />                  <stop offset="95%" stopColor="#ef4444" stopOpacity={0} />                </linearGradient>              </defs>              <Tooltip cursor={false} content={() => null} />              <Area                type="monotone"                dataKey="quality"                stroke="#ef4444"                fill="url(#qualityGradient)"                strokeWidth={2}              />            </AreaChart>          </ResponsiveContainer>          <div className="absolute top-0 right-0">            <span className="text-xs font-bold text-red-500 bg-red-50 dark:bg-red-900/20 px-2 py-1 rounded">{statusLabel}</span>          </div>        </div>      </div>      <div className="absolute -bottom-4 -right-4 z-0 opacity-5 pointer-events-none">        <Radio className="w-32 h-32 text-red-500" />      </div>    </motion.div >  );};

Usage

This component helps students and teachers monitor live virtual classes and provides quick access to join active sessions.

Prop

Type