Medical
Remote Monitoring Card - Telehealth
Monitor remote patient monitoring and telehealth visits. Track virtual care engagement and compliance.
Remote Monitoring Card
The Remote Monitoring Card Monitor remote patient monitoring data and alerts.
Preview
Installation
ash npx shadcn@latest add https://vectormotion.vercel.app/registry/remote-monitoring-card.json
Remote Monitoring Card
'use client'import React from 'react';import { Wifi, Activity } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx";import { twMerge } from "tailwind-merge";import { PieChart, Pie, Cell, ResponsiveContainer } from 'recharts';function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs));}interface MonitoringData { name: string; value: number; color: string; [key: string]: any;}interface RemoteMonitoringCardProps { className?: string; title?: string; subtitle?: string; activeCount?: number; alertCount?: number; data?: MonitoringData[]; waveformColor?: string;}const DEFAULT_DATA: MonitoringData[] = [ { name: 'Active', value: 142, color: '#0ea5e9' }, // sky-500 { name: 'Alert', value: 8, color: '#ef4444' }, // red-500];const DEFAULT_TITLE = "RPM";const DEFAULT_SUBTITLE = "Remote Patient Monitoring";const DEFAULT_ACTIVE_COUNT = 142;const DEFAULT_ALERT_COUNT = 8;const DEFAULT_WAVEFORM_COLOR = "bg-sky-400/50";export const RemoteMonitoringCard: React.FC<RemoteMonitoringCardProps> = ({ className = "", title = DEFAULT_TITLE, subtitle = DEFAULT_SUBTITLE, activeCount = DEFAULT_ACTIVE_COUNT, alertCount = DEFAULT_ALERT_COUNT, data = DEFAULT_DATA, waveformColor = DEFAULT_WAVEFORM_COLOR,}) => { const isInteractive = true; const index = 36; 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-sky-300 dark:hover:border-sky-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-sky-500"></span> </span> <p className="text-sm text-muted-foreground font-medium"> {subtitle} </p> </div> </div> <div className="rounded-xl bg-sky-50 dark:bg-sky-900/20 p-2.5 text-sky-600 dark:text-sky-400 flex items-center justify-center ring-1 ring-sky-100 dark:ring-sky-800"> <Wifi className="h-5 w-5" /> </div> </div> <div className="flex-1 flex gap-2"> <div className="h-20 w-20 relative flex-shrink-0"> <ResponsiveContainer width="100%" height="100%"> <PieChart> <Pie data={data} innerRadius={25} outerRadius={36} paddingAngle={4} dataKey="value" stroke="none" > {data.map((entry, index) => ( <Cell key={`cell-${index}`} fill={entry.color} /> ))} </Pie> </PieChart> </ResponsiveContainer> <div className="absolute inset-0 flex items-center justify-center"> <Activity className="h-5 w-5 text-sky-500" /> </div> </div> <div className="flex-1 flex flex-col justify-center space-y-2"> <div className="flex justify-between text-xs"> <span className="text-muted-foreground">Active</span> <span className="font-bold text-foreground">{activeCount}</span> </div> <div className="flex justify-between text-xs"> <span className="text-muted-foreground">Alert</span> <span className="font-bold text-red-500">{alertCount}</span> </div> </div> </div> <div className="mt-3 relative h-10 bg-sky-50 dark:bg-sky-900/10 rounded-lg overflow-hidden flex items-center justify-center"> {/* Simulated waveform */} <div className="flex items-end gap-0.5 h-6"> {[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].map(i => ( <motion.div key={i} className={cn("w-1 rounded-t-full", waveformColor)} animate={{ height: [4, Math.random() * 20 + 4, 4] }} transition={{ duration: 1, repeat: Infinity, delay: i * 0.05 }} /> ))} </div> </div> </div> </motion.div> );};Usage
This component is a demo card displaying medical metrics with animated visualizations and dark mode support.
Prop
Type