Vector Motion
AI/ML

Deployment Status Card - ML Model Deployment

Monitor ML model deployment status across environments. Track deployment history, rollback status, and model serving health in production.

Deployment Status Card

The Deployment Status Card displays the current deployment status of machine learning models across different environments (dev, staging, production).

Preview

Installation

npx shadcn@latest add https://vectormotion.vercel.app/registry/deployment-status-card.json
Deployment Status Card
'use client'import React from 'react';import { Rocket, GitBranch, AlertTriangle, CheckCircle2 } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx"import { twMerge } from "tailwind-merge"import { ResponsiveContainer, BarChart, Bar, XAxis, Tooltip, Cell } from 'recharts';function cn(...inputs: ClassValue[]) {   return twMerge(clsx(inputs))}interface DeploymentData {   name: string;   value: number;   fill: string;   version: string;   [key: string]: any;}interface DeploymentStatusCardProps {   className?: string;   title?: string;   healthStatus?: string;   deploymentStatus?: string;   data?: DeploymentData[];   errorRate?: string;   rollbackStatus?: string;}const DEFAULT_DATA: DeploymentData[] = [   { name: 'Canary', value: 10, fill: '#3b82f6', version: 'v2.1' }, // Blue   { name: 'Stable', value: 90, fill: '#10b981', version: 'v2.0' }, // Emerald];const DEFAULT_TITLE = "Deployment";const DEFAULT_HEALTH_STATUS = "Healthy";const DEFAULT_DEPLOYMENT_STATUS = "Live";const DEFAULT_ERROR_RATE = "0.01%";const DEFAULT_ROLLBACK_STATUS = "Ready";export const DeploymentStatusCard: React.FC<DeploymentStatusCardProps> = ({   className = "",   title = DEFAULT_TITLE,   healthStatus = DEFAULT_HEALTH_STATUS,   deploymentStatus = DEFAULT_DEPLOYMENT_STATUS,   data = DEFAULT_DATA,   errorRate = DEFAULT_ERROR_RATE,   rollbackStatus = DEFAULT_ROLLBACK_STATUS,}) => {   return (      <motion.div         initial={{ opacity: 0, y: 20 }}         animate={{ opacity: 1, y: 0 }}         transition={{ duration: 0.5, delay: 0.2 }}         className={cn(            "relative overflow-hidden rounded-2xl border border-border bg-card text-card-foreground shadow-sm transition-all hover:border-emerald-300 dark:hover:border-emerald-700 hover:shadow-md flex flex-col h-full",            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-2 mt-1">                     <span className="text-2xl font-bold text-foreground">{healthStatus}</span>                     <span className="text-xs font-medium text-emerald-500 bg-emerald-500/10 px-1.5 py-0.5 rounded-full flex items-center gap-1">                        <div className="w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse" />                        {deploymentStatus}                     </span>                  </div>               </div>               <div className="rounded-lg border-2 border-emerald-100 dark:border-emerald-800 p-2 text-emerald-500 dark:text-emerald-400 flex items-center justify-center">                  <Rocket className="h-5 w-5" />               </div>            </div>            <div className="flex-1 w-full min-h-[100px] relative">               <ResponsiveContainer width="100%" height="100%">                  <BarChart data={data} layout="vertical" barSize={30}>                     <XAxis type="number" hide />                     <Tooltip                        cursor={{ fill: 'transparent' }}                        content={({ active, payload }) => {                           if (active && payload && payload.length) {                              return (                                 <div className="rounded-lg border border-zinc-200 dark:border-zinc-700 bg-white dark:bg-zinc-800 p-2 shadow-sm text-xs">                                    <span className="font-bold">{payload[0].payload.name}:</span> {payload[0].value}% Traffic                                 </div>                              );                           }                           return null;                        }}                     />                     <Bar dataKey="value" radius={[0, 4, 4, 0]} background={{ fill: '#f4f4f5', radius: 4 }}>                        {data.map((entry, index) => (                           <Cell key={`cell-${index}`} fill={entry.fill} />                        ))}                     </Bar>                  </BarChart>               </ResponsiveContainer>               {/* Labels Overlay */}               <div className="absolute inset-0 flex flex-col justify-center space-y-6 pointer-events-none pl-2">                  {data.map((item, index) => (                     <div key={index} className="flex items-center justify-between px-2 text-xs font-medium text-white mix-blend-difference">                        <span className="drop-shadow-sm">{item.name} ({item.version})</span>                        <span className="drop-shadow-sm">{item.value}%</span>                     </div>                  ))}               </div>            </div>            <div className="mt-2 grid grid-cols-2 gap-2 text-xs">               <div className="flex items-center justify-between p-2 rounded bg-muted border border-border">                  <span className="text-muted-foreground flex items-center gap-1"><AlertTriangle className="w-3 h-3" /> Errors</span>                  <span className="font-bold text-foreground">{errorRate}</span>               </div>               <div className="flex items-center justify-between p-2 rounded bg-emerald-50 dark:bg-emerald-900/10 border border-emerald-100 dark:border-emerald-800">                  <span className="text-emerald-500 flex items-center gap-1"><CheckCircle2 className="w-3 h-3" /> Rollback</span>                  <span className="font-bold text-emerald-700 dark:text-emerald-300">{rollbackStatus}</span>               </div>            </div>            <div className="absolute -bottom-4 -right-4 z-0 opacity-5 pointer-events-none">               <GitBranch className="w-40 h-40 text-emerald-500" />            </div>         </div>      </motion.div>   );};

Props

Prop

Type

Usage

This component is a demo card displaying deployment status with animated visualizations and dark mode support.