Medical
Waitlist Capacity Card - Scheduling
Monitor waitlist status and appointment availability. Track waiting times and scheduling capacity.
Waitlist Capacity Card
The Waitlist Capacity Card Monitor patient waitlist capacity and scheduling availability.
Preview
Installation
ash npx shadcn@latest add https://vectormotion.vercel.app/registry/waitlist-capacity-card.json
Waitlist Capacity Card
'use client'import React from 'react';import { Users2, AlertTriangle } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";import { RadialBarChart, RadialBar, PolarAngleAxis, ResponsiveContainer } from 'recharts';function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs));}interface CapacityData { name: string; value: number; fill: string; [key: string]: any;}interface WaitlistDepartment { name: string; count: number;}interface WaitlistCapacityCardProps { className?: string; title?: string; subtitle?: string; capacityData?: CapacityData[]; capacityStatus?: string; capacityLabel?: string; departments?: WaitlistDepartment[];}const DEFAULT_CAPACITY_DATA: CapacityData[] = [{ name: 'Capacity', value: 85, fill: '#f97316' }];const DEFAULT_DEPARTMENTS: WaitlistDepartment[] = [ { name: 'Cardiology', count: 42 }, { name: 'Orthopedics', count: 12 },];const DEFAULT_TITLE = "Waitlist";const DEFAULT_SUBTITLE = "Department Load";const DEFAULT_CAPACITY_STATUS = "High";const DEFAULT_CAPACITY_LABEL = "85% Capacity";export const WaitlistCapacityCard: React.FC<WaitlistCapacityCardProps> = ({ className = "", title = DEFAULT_TITLE, subtitle = DEFAULT_SUBTITLE, capacityData = DEFAULT_CAPACITY_DATA, capacityStatus = DEFAULT_CAPACITY_STATUS, capacityLabel = DEFAULT_CAPACITY_LABEL, departments = DEFAULT_DEPARTMENTS,}) => { const isInteractive = true; const index = 12; return ( <motion.div layoutId={isInteractive ? `card-${index}-${title}` : undefined} transition={{ duration: 0.4, ease: "easeOut" }} className={cn( "relative overflow-hidden rounded-2xl border border-border bg-card text-card-foreground shadow-sm transition-all flex flex-col h-full", isInteractive ? "hover:border-orange-300 dark:hover:border-orange-700 hover:shadow-md" : "", className )} > <div className="p-5 flex flex-col h-full relative z-10"> <div className="mb-2 flex items-start justify-between"> <div> <h3 className="font-bold text-lg text-foreground"> {title} </h3> <div className="flex items-center gap-1.5 mt-1"> <span className="relative flex h-2 w-2"> <span className="relative inline-flex rounded-full h-2 w-2 bg-orange-500"></span> </span> <p className="text-sm text-muted-foreground font-medium"> {subtitle} </p> </div> </div> <div className="rounded-xl bg-orange-500/10 p-2.5 text-orange-500 flex items-center justify-center ring-1 ring-orange-100 dark:ring-orange-800"> <Users2 className="h-5 w-5" /> </div> </div> <div className="flex-1 flex flex-col items-center"> <div className="relative h-28 w-48 -mt-4"> <ResponsiveContainer width="100%" height="100%"> <RadialBarChart cy="80%" innerRadius="140%" outerRadius="180%" barSize={16} data={capacityData} startAngle={180} endAngle={0} > <PolarAngleAxis type="number" domain={[0, 100]} angleAxisId={0} tick={false} /> <RadialBar background dataKey="value" cornerRadius={8} /> </RadialBarChart> </ResponsiveContainer> <div className="absolute bottom-0 left-0 right-0 flex flex-col items-center"> <span className="text-3xl font-bold text-foreground">{capacityStatus}</span> <span className="text-xs font-semibold text-orange-500">{capacityLabel}</span> </div> </div> <div className="w-full space-y-2 mt-4"> {departments.map((dept, i) => ( <div key={i} className="flex justify-between items-center text-xs p-2 bg-muted rounded-lg"> <span className="text-muted-foreground font-medium">{dept.name}</span> <span className="font-bold text-foreground">{dept.count} <span className="text-zinc-400 font-normal">waiting</span></span> </div> ))} </div> </div> </div> </motion.div> );};Usage
This component is a demo card displaying medical metrics with animated visualizations and dark mode support.
Prop
Type