Education
Class Supplies Card - Resource Management
Track classroom supply inventory and resource requests. Monitor supply fulfillment and procurement status.
Class Supplies Card
The Class Supplies Card displays classroom supply inventory status, showing which items are in stock, low, or need refilling.
Preview
Installation
npx shadcn@latest add https://vectormotion.vercel.app/registry/class-supplies-card.jsonClass Supplies Card
'use client'import React from 'react';import { Box } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";import { ResponsiveContainer, RadialBarChart, RadialBar, Tooltip } from 'recharts';function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs));}interface SupplyData { name: string; count: number; fill: string; [key: string]: any;}interface ClassSuppliesCardProps { className?: string; title?: string; subtitle?: string; itemCount?: number; data?: SupplyData[];}const DEFAULT_DATA: SupplyData[] = [ { name: 'Paper', count: 30, fill: '#f59e0b' }, { name: 'Markers', count: 70, fill: '#10b981' }, { name: 'Notebooks', count: 90, fill: '#3b82f6' },];const DEFAULT_TITLE = "Supplies";const DEFAULT_SUBTITLE = "Inventory Status";const DEFAULT_ITEM_COUNT = 3;export const ClassSuppliesCard: React.FC<ClassSuppliesCardProps> = ({ className = "", title = DEFAULT_TITLE, subtitle = DEFAULT_SUBTITLE, itemCount = DEFAULT_ITEM_COUNT, data = DEFAULT_DATA,}) => { return ( <motion.div initial={{ opacity: 0, y: 20 }} animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.5, delay: 0.4 }} className={cn( "relative overflow-hidden rounded-2xl border border-border bg-card text-card-foreground shadow-sm transition-all hover:border-primary/50 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-blue-500/10 p-2.5 text-blue-500 dark:text-blue-400 flex items-center justify-center ring-1 ring-blue-100 dark:ring-blue-800"> <Box className="h-5 w-5" /> </div> </div> <div className="flex-1 w-full min-h-[120px] relative"> <ResponsiveContainer width="100%" height="100%"> <RadialBarChart cx="50%" cy="50%" innerRadius="30%" outerRadius="100%" barSize={10} data={data} startAngle={90} endAngle={450} > <RadialBar background dataKey="count" cornerRadius={10} /> <Tooltip cursor={false} content={() => null} /> </RadialBarChart> </ResponsiveContainer> <div className="absolute inset-0 flex items-center justify-center pointer-events-none"> <div className="text-center"> <span className="text-xl font-bold text-foreground">{itemCount}</span> <p className="text-[9px] text-muted-foreground uppercase tracking-wider">Items</p> </div> </div> </div> <button className="w-full mt-2 py-1.5 text-xs font-medium text-zinc-600 dark:text-zinc-300 border border-zinc-200 dark:border-zinc-700 rounded-lg hover:bg-zinc-50 dark:hover:bg-zinc-800 transition-colors"> Request Refill </button> </div> <div className="absolute -bottom-4 -right-4 z-0 opacity-5 pointer-events-none"> <Box className="w-32 h-32 text-blue-500" /> </div> </motion.div> );};Usage
This component helps teachers and administrators track classroom supplies, ensuring materials are available when needed.
Prop
Type