Vector Motion
E-Commerce

Email Campaign Card - Marketing Analytics

Track email campaign performance, open rates, and click-through rates. Monitor marketing automation and campaign effectiveness.

Email Campaign Card

The Email Campaign Card Track email marketing performance and engagement.

Preview

Installation

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

Email Campaign Card
'use client';import React from "react";import { Mail, TrendingUp, MousePointer } 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 Campaign {  name: string;  sent: number;  opened: number;  clicked: number;  rate: number;  [key: string]: any;}interface EmailCampaignCardProps {  className?: string;  title?: string;  description?: string;  openRate?: string;  clickRate?: string;  totalSent?: string;  campaigns?: Campaign[];}const DEFAULT_TITLE = "Email Campaign";const DEFAULT_DESCRIPTION = "Marketing Metrics";const DEFAULT_OPEN_RATE = "28%";const DEFAULT_CLICK_RATE = "5.2%";const DEFAULT_TOTAL_SENT = "47K";const DEFAULT_CAMPAIGNS: Campaign[] = [  { name: "Summer Sale", sent: 15000, opened: 4500, clicked: 900, rate: 30 },  { name: "New Arrivals", sent: 12000, opened: 3600, clicked: 720, rate: 30 },  {    name: "Weekly Newsletter",    sent: 20000,    opened: 5000,    clicked: 750,    rate: 25,  },];export const EmailCampaignCard: React.FC<EmailCampaignCardProps> = ({  className = "",  title = DEFAULT_TITLE,  description = DEFAULT_DESCRIPTION,  openRate = DEFAULT_OPEN_RATE,  clickRate = DEFAULT_CLICK_RATE,  totalSent = DEFAULT_TOTAL_SENT,  campaigns = DEFAULT_CAMPAIGNS,}) => {  const isInteractive = true;  const index = 26;  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">          <Mail className="h-5 w-5 text-indigo-500" />        </div>      </div>      <div className="relative z-10 flex-1">        <div className="grid grid-cols-3 gap-3 mb-4">          <div>            <div className="text-xs text-muted-foreground mb-1">Open Rate</div>            <div className="text-xl font-bold text-foreground">{openRate}</div>          </div>          <div>            <div className="text-xs text-muted-foreground mb-1">Click Rate</div>            <div className="text-xl font-bold text-blue-500">{clickRate}</div>          </div>          <div>            <div className="text-xs text-muted-foreground mb-1">Total Sent</div>            <div className="text-xl font-bold text-foreground">{totalSent}</div>          </div>        </div>        <div className="space-y-3">          {campaigns.map((campaign, idx) => (            <motion.div              key={idx}              initial={{ opacity: 0, x: -10 }}              animate={{ opacity: 1, x: 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">                  {campaign.name}                </span>                <span className="text-xs text-emerald-500 font-medium">                  {campaign.rate}% open                </span>              </div>              <div className="flex justify-between text-xs text-muted-foreground">                <span>{campaign.sent.toLocaleString()} sent</span>                <span>{campaign.clicked} clicks</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