Finance
Finance Burn Rate
Track your business’s monthly cash burn and runway with this interactive Finance Burn Rate component
Finance Burn Rate
The Finance Burn Rate page presents a Cash Runway Tracker component that summarizes monthly spending and cash runway left. This visual tool helps teams understand their financial health, forecast sustainability, and make data-driven business decisions.
Preview
Installation
npx shadcn@latest add https://vectormotion.vercel.app/registry/finance-burn-rate.jsonFinance Burn Rate
'use client';import React from 'react';import { Flame, Wallet, TrendingDown, Calendar } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx"import { twMerge } from "tailwind-merge"import { ResponsiveContainer, AreaChart, Area, Tooltip } from 'recharts';function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs))}interface BurnData { month: string; value: number;}interface BurnRateBlockProps { isInteractive?: boolean; className?: string; title?: string; subtitle?: string; currentBurn?: string; trend?: string; runway?: string; runwayLabel?: string; data?: BurnData[];}const DEFAULT_TITLE = "Burn Rate";const DEFAULT_SUBTITLE = "Monthly Cash Burn";const DEFAULT_CURRENT_BURN = "$28.5k";const DEFAULT_TREND = "+12% vs last mo";const DEFAULT_RUNWAY = "14 Mo";const DEFAULT_RUNWAY_LABEL = "Until need to raise";const DEFAULT_DATA: BurnData[] = [ { month: '1', value: 24000 }, { month: '2', value: 25000 }, { month: '3', value: 28500 }, { month: '4', value: 27000 }, { month: '5', value: 29000 }, { month: '6', value: 28500 },];export const BurnRateBlock: React.FC<BurnRateBlockProps> = ({ isInteractive = false, className = "", title = DEFAULT_TITLE, subtitle = DEFAULT_SUBTITLE, currentBurn = DEFAULT_CURRENT_BURN, trend = DEFAULT_TREND, runway = DEFAULT_RUNWAY, runwayLabel = DEFAULT_RUNWAY_LABEL, data = DEFAULT_DATA,}) => { const index = 24; 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-5 shadow-sm transition-all flex flex-col h-full group", isInteractive ? "cursor-pointer hover:border-primary/50 hover:shadow-md" : "", className )} > <div className="mb-4 flex items-start justify-between relative z-10"> <div> <h3 className="font-semibold text-lg text-foreground"> {title} </h3> <p className="text-sm text-muted-foreground mt-1">{subtitle}</p> </div> <div className="rounded-lg bg-orange-500/10 p-2 text-orange-500"> <Flame className="h-5 w-5" /> </div> </div> <div className="relative z-10 flex-1 grid grid-cols-2 gap-4"> <div className="flex flex-col justify-center"> <div className="flex items-center gap-2 mb-1"> <span className="text-3xl font-bold text-foreground">{currentBurn}</span> </div> <div className="flex items-center gap-1.5 text-xs text-rose-500 bg-rose-500/10 px-2 py-1 rounded-md w-fit"> <TrendingDown className="w-3 h-3" /> <span>{trend}</span> </div> </div> <div className="flex flex-col justify-center items-end text-right border-l border-border pl-4"> <div className="flex items-center gap-1.5 text-muted-foreground mb-1"> <Calendar className="w-4 h-4" /> <span className="text-xs font-medium uppercase tracking-wider">Runway</span> </div> <span className="text-2xl font-bold text-foreground">{runway}</span> <span className="text-[10px] text-muted-foreground">{runwayLabel}</span> </div> </div> <div className="relative z-10 h-10 mt-4 -mx-2 opacity-50 hover:opacity-100 transition-opacity"> <ResponsiveContainer width="100%" height="100%"> <AreaChart data={data}> <defs> <linearGradient id="colorBurn" x1="0" y1="0" x2="0" y2="1"> <stop offset="5%" stopColor="#f97316" stopOpacity={0.3} /> <stop offset="95%" stopColor="#f97316" stopOpacity={0} /> </linearGradient> </defs> <Tooltip cursor={false} contentStyle={{ display: 'none' }} /> <Area type="monotone" dataKey="value" stroke="#f97316" fillOpacity={1} fill="url(#colorBurn)" strokeWidth={2} /> </AreaChart> </ResponsiveContainer> </div> <div className="absolute -bottom-4 -right-4 z-0 opacity-[0.03] pointer-events-none"> <Wallet className="w-24 h-24 text-foreground" /> </div> </motion.div> );};Props
Prop
Type