Vector Motion
Medical

Vaccination Rate Card - Immunization

Monitor vaccination rates and immunization compliance. Track vaccine administration and population immunity.

Vaccination Rate Card

The Vaccination Rate Card Monitor patient vaccination compliance rates.

Preview

Installation

ash npx shadcn@latest add https://vectormotion.vercel.app/registry/vaccination-rate-card.json

Vaccination Rate Card
'use client'import React from 'react';import { Syringe, CheckCircle } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";function cn(...inputs: ClassValue[]) {   return twMerge(clsx(inputs));}interface Vaccination {   name: string;   percentage: number;   color: string;   icon?: React.ReactNode;}interface VaccinationRateCardProps {   className?: string;   title?: string;   subtitle?: string;   vaccinations?: Vaccination[];}const DEFAULT_VACCINATIONS: Vaccination[] = [   { name: "Flu Shot", percentage: 94, color: "bg-emerald-500", icon: <CheckCircle className="h-3 w-3" /> },   { name: "Pneumococcal", percentage: 88, color: "bg-blue-500" }];const DEFAULT_TITLE = "Vaccines";const DEFAULT_SUBTITLE = "Patient Compliance";export const VaccinationRateCard: React.FC<VaccinationRateCardProps> = ({   className = "",   title = DEFAULT_TITLE,   subtitle = DEFAULT_SUBTITLE,   vaccinations = DEFAULT_VACCINATIONS,}) => {   const isInteractive = true;   const index = 26;   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-primary/50 hover:shadow-md" : "",            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-1.5 mt-1">                     <span className="relative flex h-2 w-2">                        <span className="relative inline-flex rounded-full h-2 w-2 bg-blue-500"></span>                     </span>                     <p className="text-sm text-muted-foreground font-medium">                        {subtitle}                     </p>                  </div>               </div>               <div className="rounded-xl bg-blue-500/10 p-2.5 text-blue-500 flex items-center justify-center ring-1 ring-blue-100 dark:ring-blue-800">                  <Syringe className="h-5 w-5" />               </div>            </div>            <div className="flex-1 space-y-4">               {vaccinations.map((vax, i) => (                  <div key={i}>                     <div className="flex justify-between items-center mb-1.5">                        <span className="text-sm font-semibold text-foreground">{vax.name}</span>                        <span className={cn("text-sm font-bold flex items-center gap-1", vax.color.replace('bg-', 'text-'))}>                           {vax.icon && vax.icon} {vax.percentage}%                        </span>                     </div>                     <div className="w-full bg-zinc-100 dark:bg-zinc-800 rounded-full h-2 overflow-hidden">                        <motion.div                           initial={{ width: 0 }}                           animate={{ width: `${vax.percentage}%` }}                           transition={{ delay: i * 0.1 }}                           className={cn("h-full rounded-full", vax.color)}                        />                     </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