terra vidhal

Budget Planner

Component

About

A monthly budget planner with editable envelopes, real spending, alert thresholds, a distribution bar, risk filters and automatic rebalancing.

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

Code

How Budget Planner 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 {
  Car,
  GraduationCap,
  HeartPulse,
  House,
  Sparkles,
  UtensilsCrossed,
} from "lucide-react";
import { BudgetPlanner, type BudgetCategory } from "@/components/ui/budget-planner";

const CATEGORIES: BudgetCategory[] = [
  {
    id: "housing",
    name: "Housing",
    spent: 2100,
    limit: 2100,
    tone: "violet",
    icon: <House className="size-3.5" aria-hidden="true" />,
    note: "Rent, utilities and building insurance.",
    trend: [1980, 2010, 2050, 2040, 2080, 2100],
  },
  {
    id: "groceries",
    name: "Groceries",
    spent: 634,
    limit: 700,
    tone: "emerald",
    icon: <UtensilsCrossed className="size-3.5" aria-hidden="true" />,
    note: "Weekly shop and the Saturday market.",
    trend: [520, 548, 566, 590, 612, 634],
  },
  {
    id: "transport",
    name: "Transport",
    spent: 268,
    limit: 320,
    tone: "sky",
    icon: <Car className="size-3.5" aria-hidden="true" />,
    note: "Transit pass, fuel and occasional rides.",
    trend: [210, 224, 236, 242, 255, 268],
  },
  {
    id: "health",
    name: "Health",
    spent: 146,
    limit: 180,
    tone: "rose",
    icon: <HeartPulse className="size-3.5" aria-hidden="true" />,
    note: "Gym, prescriptions and the dentist fund.",
    trend: [120, 132, 128, 140, 138, 146],
  },
  {
    id: "learning",
    name: "Learning",
    spent: 92,
    limit: 150,
    tone: "amber",
    icon: <GraduationCap className="size-3.5" aria-hidden="true" />,
    note: "Courses, books and conference tickets.",
    trend: [60, 72, 68, 84, 90, 92],
  },
  {
    id: "leisure",
    name: "Leisure",
    spent: 286,
    limit: 250,
    tone: "teal",
    icon: <Sparkles className="size-3.5" aria-hidden="true" />,
    note: "Dinners, cinema and the occasional concert.",
    trend: [180, 205, 220, 244, 262, 286],
  },
];

export default function BudgetPlannerDemo() {
  return (
    <main className="flex min-h-screen w-full items-center justify-center bg-gradient-to-b from-muted/40 via-background to-background px-4 py-6 sm:px-6">
      <BudgetPlanner
        variant="plain"
        income={6800}
        categories={CATEGORIES}
        monthLabel="November plan"
        title="Household budget"
        defaultFilter="all"
        defaultAllocations={{ groceries: 760 }}
      />
    </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.