E-Commerce
Order Accuracy Card - Quality Metrics
Monitor order accuracy rates and fulfillment quality. Track picking and packing errors to improve order quality.
Order Accuracy Card
The Order Accuracy Card Track fulfillment accuracy and error rates.
Preview
Installation
ash npx shadcn@latest add https://vectormotion.vercel.app/registry/order-accuracy-card.json
Order Accuracy Card
'use client';import React from "react";import { CheckCircle, TrendingUp } 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 Metric { metric: string; rate: number; count: number; [key: string]: any;}interface OrderAccuracyCardProps { className?: string; title?: string; description?: string; overallAccuracy?: string; metrics?: Metric[];}const DEFAULT_TITLE = "Order Accuracy";const DEFAULT_DESCRIPTION = "Fulfillment Quality";const DEFAULT_OVERALL_ACCURACY = "97.9%";const DEFAULT_METRICS: Metric[] = [ { metric: "Correct Items", rate: 98.5, count: 4925 }, { metric: "On-Time Delivery", rate: 96.2, count: 4810 }, { metric: "Proper Packaging", rate: 99.1, count: 4955 }, { metric: "Complete Orders", rate: 97.8, count: 4890 },];export const OrderAccuracyCard: React.FC<OrderAccuracyCardProps> = ({ className = "", title = DEFAULT_TITLE, description = DEFAULT_DESCRIPTION, overallAccuracy = DEFAULT_OVERALL_ACCURACY, metrics = DEFAULT_METRICS,}) => { 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-xl border border-border bg-card text-card-foreground p-6 shadow-sm transition-all flex flex-col group", isInteractive ? "cursor-pointer hover:border-zinc-300 dark:hover:border-zinc-700" : "", className, )} > <div className="mb-4 flex items-start justify-between relative z-10"> <div> <h3 className="font-semibold text-lg tracking-tight text-foreground"> {title} </h3> {description && ( <p className="text-sm text-muted-foreground mt-1">{description}</p> )} </div> <div className="rounded-full bg-zinc-100 dark:bg-zinc-800 p-2 text-foreground flex items-center justify-center"> <CheckCircle className="h-5 w-5 text-emerald-500" /> </div> </div> <div className="relative z-10 flex-1"> <div className="flex items-baseline gap-2 mb-2"> <div className="text-3xl font-bold text-emerald-500"> {overallAccuracy} </div> <TrendingUp className="h-5 w-5 text-emerald-500" /> </div> <p className="text-sm text-muted-foreground mb-4"> Overall accuracy rate </p> <div className="space-y-3"> {metrics.map((item, idx) => ( <div key={idx}> <div className="flex justify-between items-center mb-1"> <span className="text-sm text-foreground">{item.metric}</span> <div className="flex items-center gap-2"> <span className="text-xs text-muted-foreground"> {item.count} </span> <span className="text-sm font-bold text-emerald-500"> {item.rate}% </span> </div> </div> <div className="flex-1 bg-zinc-100 dark:bg-zinc-800 rounded-full h-2 overflow-hidden"> <motion.div initial={{ width: 0 }} animate={{ width: `${item.rate}%` }} transition={{ duration: 1, delay: idx * 0.1 }} className="h-full bg-emerald-500 rounded-full" /> </div> </div> ))} </div> </div> </motion.div> );};Usage
This component is a data-rich dashboard card displaying e-commerce metrics with animated visualizations and dark mode support. Perfect for dashboards, landing pages, and analytics interfaces.
Prop
Type