VectorMotion
Medical

Medication Error Card - Medication Safety

Track medication errors and near-miss incidents. Monitor patient safety and medication compliance.

Medication Error Card

The Medication Error Card Track medication error incidents and prevention measures.

Preview

Installation

ash npx shadcn@latest add https://www.vectormotion.dev/registry/medication-error-card.json

Medication Error Card
'use client'import React from 'react';import { AlertTriangle, ShieldCheck } 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 MedicationErrorCardProps {   className?: string;   title?: string;   subtitle?: string;   daysSinceLastEvent?: number;   previousRecord?: number;}const DEFAULT_TITLE = "Safety";const DEFAULT_SUBTITLE = "Zero Harm Target";const DEFAULT_DAYS_SINCE_LAST_EVENT = 142;const DEFAULT_PREVIOUS_RECORD = 128;export const MedicationErrorCard: React.FC<MedicationErrorCardProps> = ({   className = "",   title = DEFAULT_TITLE,   subtitle = DEFAULT_SUBTITLE,   daysSinceLastEvent = DEFAULT_DAYS_SINCE_LAST_EVENT,   previousRecord = DEFAULT_PREVIOUS_RECORD,}) => {   const isInteractive = true;   const index = 27;   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-emerald-500"></span>                     </span>                     <p className="text-sm text-muted-foreground font-medium">                        {subtitle}                     </p>                  </div>               </div>               <div className="rounded-xl bg-emerald-500/10 p-2.5 text-emerald-500 flex items-center justify-center ring-1 ring-emerald-100 dark:ring-emerald-800">                  <ShieldCheck className="h-5 w-5" />               </div>            </div>            <div className="flex-1 flex flex-col items-center justify-center py-2">               <div className="relative mb-2">                  <div className="absolute inset-0 bg-emerald-400/20 blur-xl rounded-full animate-pulse" />                  <span className="relative text-6xl font-black text-emerald-500 tracking-tighter">{daysSinceLastEvent}</span>               </div>               <p className="text-xs font-bold uppercase tracking-widest text-muted-foreground">Days Since Last Event</p>            </div>            <div className="mt-2 text-center">               <span className="inline-flex items-center gap-1.5 px-2 py-1 bg-zinc-100 dark:bg-zinc-800 rounded-full text-[10px] font-medium text-muted-foreground">                  Previous Record: <span className="text-foreground font-bold">{previousRecord} Days</span>               </span>            </div>         </div>      </motion.div>   );};

Usage

This component is a demo card displaying medical metrics with animated visualizations and dark mode support.

Prop

Type

On this page

Free block

Need this in production?

Unlock install commands, source access, commercial use, and AI prompts for all VectorMotion blocks.