Vector Motion
E-Commerce

Return Processing Card - Returns Workflow

Track return request processing and reverse logistics. Monitor return approval rates and processing times.

Return Processing Card

The Return Processing Card Monitor returns workflow and processing status.

Preview

Installation

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

Return Processing Card
'use client';import React from "react";import { RotateCcw, TrendingDown } 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 Status {  status: string;  count: number;  time: string;  color: string;  [key: string]: any;}interface ReturnProcessingCardProps {  className?: string;  title?: string;  description?: string;  activeReturns?: number;  returnsChange?: number;  statuses?: Status[];}const DEFAULT_TITLE = "Return Processing";const DEFAULT_DESCRIPTION = "Returns Workflow";const DEFAULT_ACTIVE_RETURNS = 329;const DEFAULT_RETURNS_CHANGE = -8;const DEFAULT_STATUSES: Status[] = [  { status: "Pending", count: 45, time: "<24h", color: "bg-amber-500" },  { status: "Inspecting", count: 28, time: "1-2d", color: "bg-blue-500" },  { status: "Refunding", count: 67, time: "2-3d", color: "bg-purple-500" },  { status: "Completed", count: 189, time: "<3d", color: "bg-emerald-500" },];export const ReturnProcessingCard: React.FC<ReturnProcessingCardProps> = ({  className = "",  title = DEFAULT_TITLE,  description = DEFAULT_DESCRIPTION,  activeReturns = DEFAULT_ACTIVE_RETURNS,  returnsChange = DEFAULT_RETURNS_CHANGE,  statuses = DEFAULT_STATUSES,}) => {  const isInteractive = true;  const index = 35;  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">          <RotateCcw className="h-5 w-5 text-purple-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-foreground">            {activeReturns}          </div>          <div className="flex items-center gap-1 text-sm">            <TrendingDown className="h-4 w-4 text-emerald-500" />            <span className="text-emerald-500">{returnsChange}%</span>          </div>        </div>        <p className="text-sm text-muted-foreground mb-4">Active returns</p>        <div className="space-y-3">          {statuses.map((item, idx) => (            <div key={idx}>              <div className="flex justify-between items-center mb-1">                <div className="flex items-center gap-2">                  <span className="text-sm text-foreground">{item.status}</span>                  <span className="text-xs text-muted-foreground">                    {item.time}                  </span>                </div>                <span className="text-sm font-bold text-foreground">                  {item.count}                </span>              </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.count / activeReturns) * 100}%` }}                  transition={{ duration: 1, delay: idx * 0.1 }}                  className={`h-full ${item.color} 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