Medical
Medical Alerts Card - Clinical Alerts
Monitor medical alerts and clinical notifications. Track critical alerts and response times.
Medical Alerts Card
The Medical Alerts Card Display critical medical alerts and patient safety notifications.
Preview
Installation
ash npx shadcn@latest add https://vectormotion.vercel.app/registry/medical-alerts-card.json
Medical Alerts Card
'use client'import React from 'react';import { AlertTriangle, Bell, Info } 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 AlertItem { type: 'critical' | 'warning' | 'info'; title: string; message: string; time?: string; location?: string;}interface MedicalAlertsCardProps { className?: string; title?: string; subtitle?: string; alerts?: AlertItem[];}const DEFAULT_ALERTS: AlertItem[] = [ { type: 'critical', title: "Code Blue", message: "Room 302 - Cardiac Arrest", time: "Now", location: "Room 302" }, { type: 'warning', title: "Supply", message: "O- Blood Type Critical", time: "12m ago" }];const DEFAULT_TITLE = "Alerts";const DEFAULT_SUBTITLE = "Action Required";export const MedicalAlertsCard: React.FC<MedicalAlertsCardProps> = ({ className = "", title = DEFAULT_TITLE, subtitle = DEFAULT_SUBTITLE, alerts = DEFAULT_ALERTS,}) => { const isInteractive = true; const index = 5; 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-red-300 dark:hover:border-red-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-red-500 animate-pulse"></span> </span> <p className="text-sm text-muted-foreground font-medium"> {subtitle} </p> </div> </div> <div className="rounded-xl bg-red-50 dark:bg-red-900/20 p-2.5 text-red-600 dark:text-red-400 flex items-center justify-center ring-1 ring-red-100 dark:ring-red-800"> <Bell className="h-5 w-5" /> </div> </div> <div className="flex-1 space-y-2 mt-2"> {alerts.map((alert, i) => ( <motion.div key={i} whileHover={{ scale: 1.02 }} className={cn( "p-3 rounded-xl relative overflow-hidden border", alert.type === 'critical' ? "bg-red-50 dark:bg-red-900/20 border-red-100 dark:border-red-900/30" : alert.type === 'warning' ? "bg-amber-500/10 border-amber-100 dark:border-amber-900/30" : "bg-blue-50 dark:bg-blue-900/10 border-blue-100 dark:border-blue-900/30" )} > <div className={cn("absolute left-0 top-0 bottom-0 w-1", alert.type === 'critical' ? "bg-red-500" : alert.type === 'warning' ? "bg-amber-400" : "bg-blue-500" )} /> <div className="flex items-start gap-3"> <div className={cn("p-1.5 rounded-lg flex-shrink-0", alert.type === 'critical' ? "bg-red-100 dark:bg-red-900/40" : alert.type === 'warning' ? "bg-amber-100 dark:bg-amber-900/40" : "bg-blue-100 dark:bg-blue-900/40" )}> {alert.type === 'critical' ? <AlertTriangle className="h-4 w-4 text-red-600 dark:text-red-400" /> : alert.type === 'warning' ? <Info className="h-4 w-4 text-amber-500" /> : <Info className="h-4 w-4 text-blue-500" />} </div> <div> <div className="flex items-center gap-2 mb-0.5"> <p className={cn("text-xs font-bold uppercase tracking-tight", alert.type === 'critical' ? "text-red-700 dark:text-red-300" : alert.type === 'warning' ? "text-amber-700 dark:text-amber-300" : "text-blue-700 dark:text-blue-300" )}>{alert.title}</p> {alert.time && ( <span className={cn("text-[10px] opacity-80", alert.type === 'critical' ? "text-red-500" : alert.type === 'warning' ? "text-amber-500" : "text-blue-500" )}>{alert.time}</span> )} </div> <p className="text-sm font-semibold text-foreground leading-tight">{alert.message}</p> </div> </div> </motion.div> ))} </div> </div> </motion.div> );};Usage
This component is a demo card displaying medical metrics with animated visualizations and dark mode support.
Prop
Type