Vector Motion
Finance

Return on Equity Card - Shareholder Returns

Monitor return on equity and shareholder value. Track ROE performance and value creation.

Finance ROE Card

The Finance ROE Card displays Return on Equity metrics, measuring the profitability generated from shareholders' equity.

Preview

Installation

npx shadcn@latest add https://vectormotion.vercel.app/registry/finance-roe-card.json
Finance ROE Card
'use client'import React from 'react';import { PieChart, TrendingUp } from 'lucide-react';import { motion } from 'motion/react';import { clsx, type ClassValue } from "clsx"import { twMerge } from "tailwind-merge"import { ResponsiveContainer, RadialBarChart, RadialBar, PolarAngleAxis } from 'recharts';function cn(...inputs: ClassValue[]) {  return twMerge(clsx(inputs))}interface ROEData {  name: string;  value: number;  fill: string;  [key: string]: any;}interface ROECardProps {  isInteractive?: boolean;  className?: string;  title?: string;  roeLabel?: string;  roeStatus?: string;  leverageLabel?: string;  leverageStatus?: string;  equityLabel?: string;  equityStatus?: string;  data?: ROEData[];}const DEFAULT_TITLE = "ROE";const DEFAULT_ROE_LABEL = "14.2%";const DEFAULT_ROE_STATUS = "High";const DEFAULT_LEVERAGE_LABEL = "Leverage";const DEFAULT_LEVERAGE_STATUS = "Optimal";const DEFAULT_EQUITY_LABEL = "Shareholder Equity";const DEFAULT_EQUITY_STATUS = "Rising";const DEFAULT_DATA: ROEData[] = [{ name: 'ROE', value: 14.2, fill: '#3b82f6' }]; // Blueexport const ROECard: React.FC<ROECardProps> = ({  isInteractive = true,  className = "",  title = DEFAULT_TITLE,  roeLabel = DEFAULT_ROE_LABEL,  roeStatus = DEFAULT_ROE_STATUS,  leverageLabel = DEFAULT_LEVERAGE_LABEL,  leverageStatus = DEFAULT_LEVERAGE_STATUS,  equityLabel = DEFAULT_EQUITY_LABEL,  equityStatus = DEFAULT_EQUITY_STATUS,  data = DEFAULT_DATA,}) => {  const index = 38;  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-2 flex items-start justify-between relative z-10">        <div>          <h3 className="font-semibold text-lg text-foreground">            {title}          </h3>          <div className="flex items-center gap-2 mt-1">            <span className="text-2xl font-bold text-foreground">{roeLabel}</span>            <span className="text-xs bg-blue-500/10 text-blue-600 px-1.5 py-0.5 rounded-full flex items-center gap-0.5">              <TrendingUp className="w-3 h-3" /> {roeStatus}            </span>          </div>        </div>        <div className="rounded-lg bg-emerald-500/10 p-2 text-emerald-500">          <PieChart className="h-5 w-5" />        </div>      </div>      <div className="relative z-10 flex-1 min-h-[120px] flex items-center justify-center">        <div className="h-[120px] w-full relative">          <ResponsiveContainer width="100%" height="100%">            <RadialBarChart              cx="50%"              cy="50%"              innerRadius="60%"              outerRadius="90%"              barSize={12}              data={data}              startAngle={180}              endAngle={0}            >              <PolarAngleAxis                type="number"                domain={[0, 20]}                angleAxisId={0}                tick={false}              />              <RadialBar                background={{ fill: '#f4f4f5' }} // zinc-100                dataKey="value"                cornerRadius={10}              />            </RadialBarChart>          </ResponsiveContainer>          <div className="absolute inset-0 flex flex-col items-center justify-center pointer-events-none pb-4">            <span className="text-xs text-muted-foreground">{leverageLabel}</span>            <span className="font-bold text-foreground">{leverageStatus}</span>          </div>        </div>      </div>      <div className="z-10 mt-2 flex items-center justify-between text-xs pt-2 border-t border-border">        <span>{equityLabel}</span>        <span className="text-muted-foreground">{equityStatus}</span>      </div>    </motion.div>  );};

Props

Prop

Type

Usage

This component is a demo card displaying ROE metrics with animated visualizations and dark mode support.