Vector Motion
E-Commerce

Delivery Time Card - Logistics Analytics

Monitor average delivery times and fulfillment timelines. Track shipping performance and customer delivery satisfaction.

Delivery Time Card

The Delivery Time Card Analyze shipping time and delivery performance.

Preview

Installation

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

Delivery Time Card
'use client';import React from "react";import { Clock, Package } 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 Zone {  zone: string;  avgTime: string;  onTime: number;}interface DeliveryTimeCardProps {  className?: string;  title?: string;  description?: string;  averageDeliveryTime?: string;  zones?: Zone[];}const DEFAULT_TITLE = "Delivery Time";const DEFAULT_DESCRIPTION = "Shipping Performance";const DEFAULT_AVERAGE_DELIVERY_TIME = "2.4 days";const DEFAULT_ZONES: Zone[] = [  { zone: "Local (<50mi)", avgTime: "1.2 days", onTime: 98 },  { zone: "Regional (50-200mi)", avgTime: "2.1 days", onTime: 95 },  { zone: "National (200+mi)", avgTime: "3.8 days", onTime: 92 },];export const DeliveryTimeCard: React.FC<DeliveryTimeCardProps> = ({  className = "",  title = DEFAULT_TITLE,  description = DEFAULT_DESCRIPTION,  averageDeliveryTime = DEFAULT_AVERAGE_DELIVERY_TIME,  zones = DEFAULT_ZONES,}) => {  const isInteractive = true;  const index = 37;  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">          <Clock className="h-5 w-5 text-blue-500" />        </div>      </div>      <div className="relative z-10 flex-1">        <div className="text-2xl font-bold text-foreground mb-1">          {averageDeliveryTime}        </div>        <p className="text-sm text-muted-foreground mb-4">          Average delivery time        </p>        <div className="space-y-3">          {zones.map((zone, idx) => (            <motion.div              key={idx}              initial={{ opacity: 0, y: 5 }}              animate={{ opacity: 1, y: 0 }}              transition={{ duration: 0.4, delay: idx * 0.1 }}              className="bg-muted rounded-lg p-3"            >              <div className="flex justify-between items-center mb-2">                <span className="text-sm font-medium text-foreground">                  {zone.zone}                </span>                <span className="text-sm font-bold text-blue-500">                  {zone.avgTime}                </span>              </div>              <div className="flex justify-between text-xs text-muted-foreground">                <span>On-time delivery</span>                <span className="text-emerald-500 font-medium">                  {zone.onTime}%                </span>              </div>            </motion.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