Vector Motion
Medical

Genetic Testing Card - Genomics

Monitor genetic testing orders and results. Track genomic analysis and personalized medicine applications.

Genetic Testing Card

The Genetic Testing Card Monitor genetic testing orders, results, and turnaround times.

Preview

Installation

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

Genetic Testing Card
'use client'import React from 'react';import { Dna, Fingerprint, Search } 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 GeneticPanel {   name: string;   status: 'processing' | 'completed';   daysLeft: number;}interface GeneticTestingCardProps {   className?: string;   title?: string;   subtitle?: string;   activeCount?: number;   completedCount?: number;   panels?: GeneticPanel[];}const DEFAULT_PANELS: GeneticPanel[] = [   { name: "BRCA1/2", status: 'processing', daysLeft: 3 },   { name: "Lynch Syn.", status: 'processing', daysLeft: 5 },   { name: "Pharmaco.", status: 'completed', daysLeft: 0 },];const DEFAULT_TITLE = "Genetics";const DEFAULT_SUBTITLE = "Panel Analysis";const DEFAULT_ACTIVE_COUNT = 8;const DEFAULT_COMPLETED_COUNT = 12;export const GeneticTestingCard: React.FC<GeneticTestingCardProps> = ({   className = "",   title = DEFAULT_TITLE,   subtitle = DEFAULT_SUBTITLE,   activeCount = DEFAULT_ACTIVE_COUNT,   completedCount = DEFAULT_COMPLETED_COUNT,   panels = DEFAULT_PANELS,}) => {   const isInteractive = true;   const index = 49;   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-fuchsia-300 dark:hover:border-fuchsia-700 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-fuchsia-500"></span>                     </span>                     <p className="text-sm text-muted-foreground font-medium">                        {subtitle}                     </p>                  </div>               </div>               <div className="rounded-xl bg-fuchsia-50 dark:bg-fuchsia-900/20 p-2.5 text-fuchsia-600 dark:text-fuchsia-400 flex items-center justify-center ring-1 ring-fuchsia-100 dark:ring-fuchsia-800">                  <Dna className="h-5 w-5" />               </div>            </div>            <div className="flex-1 space-y-3">               <div className="flex gap-2 mb-2">                  <div className="bg-muted flex-1 p-2 rounded-lg border border-border text-center">                     <span className="block text-xl font-bold text-foreground">{activeCount}</span>                     <span className="text-[10px] text-muted-foreground uppercase font-bold">Active</span>                  </div>                  <div className="bg-emerald-50 dark:bg-emerald-900/10 flex-1 p-2 rounded-lg border border-emerald-100 dark:border-emerald-900/30 text-center">                     <span className="block text-xl font-bold text-emerald-500">{completedCount}</span>                     <span className="text-[10px] text-emerald-600/70 dark:text-emerald-400/70 uppercase font-bold">Done</span>                  </div>               </div>               <div className="space-y-2">                  {panels.map((panel, i) => (                     <div key={i} className="flex items-center justify-between p-2 bg-muted/30 rounded-lg border border-border/50">                        <div className="flex items-center gap-2">                           {panel.status === 'processing' ? (                              <div className="relative flex h-2 w-2">                                 <span className="animate-ping absolute inline-flex h-full w-full rounded-full bg-fuchsia-400 opacity-75"></span>                                 <span className="relative inline-flex rounded-full h-2 w-2 bg-fuchsia-500"></span>                              </div>                           ) : (                              <div className="h-2 w-2 rounded-full bg-emerald-500" />                           )}                           <span className="text-xs font-semibold text-foreground">{panel.name}</span>                        </div>                        {panel.status === 'processing' ? (                           <span className="text-[10px] font-medium text-muted-foreground bg-card text-card-foreground px-1.5 py-0.5 rounded border border-zinc-200 dark:border-zinc-700">                              {panel.daysLeft}d left                           </span>                        ) : (                           <span className="text-[10px] font-bold text-emerald-500 uppercase">Ready</span>                        )}                     </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