Medical
Surgical Outcome Card - Surgical Quality
Monitor surgical outcomes and quality metrics. Track complication rates and surgical performance.
Surgical Outcome Card
The Surgical Outcome Card Monitor surgical procedure outcomes and complication rates.
Preview
Installation
ash npx shadcn@latest add https://vectormotion.vercel.app/registry/surgical-outcome-card.json
Surgical Outcome Card
'use client'import React from 'react';import { Scissors, Trophy } 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 OutcomeData { name: string; value: number; color: string; [key: string]: any;}interface SurgicalOutcomeCardProps { className?: string; title?: string; subtitle?: string; casesCount?: number; infectionRate?: string; successRate?: number; data?: OutcomeData[];}const DEFAULT_DATA: OutcomeData[] = [ { name: 'Success', value: 98, color: '#14b8a6' }, // teal-500 { name: 'Comp', value: 2, color: '#e5e7eb' }, // zinc-200];const DEFAULT_TITLE = "Surgery";const DEFAULT_SUBTITLE = "Outcomes YTD";const DEFAULT_CASES_COUNT = 1245;const DEFAULT_INFECTION_RATE = "0.4%";const DEFAULT_SUCCESS_RATE = 98;export const SurgicalOutcomeCard: React.FC<SurgicalOutcomeCardProps> = ({ className = "", title = DEFAULT_TITLE, subtitle = DEFAULT_SUBTITLE, casesCount = DEFAULT_CASES_COUNT, infectionRate = DEFAULT_INFECTION_RATE, successRate = DEFAULT_SUCCESS_RATE, data = DEFAULT_DATA,}) => { const isInteractive = true; const index = 16; 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-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-teal-500"></span> </span> <p className="text-sm text-muted-foreground font-medium"> {subtitle} </p> </div> </div> <div className="rounded-xl bg-teal-500/10 p-2.5 text-teal-500 flex items-center justify-center ring-1 ring-teal-100 dark:ring-teal-800"> <Scissors className="h-5 w-5" /> </div> </div> <div className="flex-1 flex flex-col items-center justify-center"> <div className="relative h-32 w-32"> <ResponsiveContainer width="100%" height="100%"> <PieChart> <Pie data={data} cx="50%" cy="50%" innerRadius={45} outerRadius={55} startAngle={90} endAngle={-270} dataKey="value" stroke="none" > {data.map((entry, index) => ( <Cell key={`cell-${index}`} fill={entry.color} /> ))} </Pie> </PieChart> </ResponsiveContainer> <div className="absolute inset-0 flex flex-col items-center justify-center"> <span className="text-3xl font-bold text-foreground">{successRate}%</span> <span className="text-[10px] uppercase font-bold text-muted-foreground">Success</span> </div> </div> <div className="mt-4 flex gap-4 w-full justify-center"> <div className="text-center"> <p className="text-lg font-bold text-foreground">{casesCount.toLocaleString()}</p> <p className="text-[10px] text-muted-foreground uppercase font-medium">Cases</p> </div> <div className="w-px bg-zinc-100 dark:bg-zinc-800" /> <div className="text-center"> <p className="text-lg font-bold text-teal-500">{infectionRate}</p> <p className="text-[10px] text-muted-foreground uppercase font-medium">Infection</p> </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