terra vidhal

Portfolio Rebalancer

Component

About

A portfolio rebalancer with an animated allocation donut, drift badges, target sliders and exact inputs, an auto-balance helper, a trade preview with turnover, and an executed state that updates the live mix.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Portfolio Rebalancer to your project and fits it to your theme.

Code

How Portfolio Rebalancer is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

"use client";

/**
 * PrequelUI Animate — MIT — https://prequeluianimate.terravidhal.me
 */

import {
  PortfolioRebalancer,
  type PortfolioAsset,
} from "@/components/ui/portfolio-rebalancer";

const ASSETS: PortfolioAsset[] = [
  { id: "equity", name: "Global equity", currentValue: 52000, target: 45 },
  { id: "bonds", name: "Government bonds", currentValue: 20000, target: 25 },
  { id: "property", name: "Property", currentValue: 14000, target: 15 },
  { id: "commodities", name: "Commodities", currentValue: 8000, target: 10 },
  { id: "cash", name: "Cash", currentValue: 6000, target: 5 },
];

export default function PortfolioRebalancerDemo() {
  return (
    <main className="flex min-h-screen w-full items-start justify-center bg-gradient-to-b from-muted/40 via-background to-background px-4 py-8 sm:px-6">
      <PortfolioRebalancer
        assets={ASSETS}
        title="Quarterly portfolio check"
      />
    </main>
  );
}

Dependencies

More by terra vidhal

View all
  • Project Timeline

    Project Timeline

    30
  • Kanban Board

    Kanban Board

    20
  • Gravity Stars Background

    Gravity Stars Background

    20
  • Booking Calendar

    Booking Calendar

    18
  • Notification Center

    Notification Center

    16
  • Audio Waveform

    Audio Waveform

    16
  • Kpi Counter

    Kpi Counter

    16
  • Topographic Lines

    Topographic Lines

    16

Explore more

Part of PrequelUI Animate — browse the full library on 21st.dev.