terra vidhal

Recipe Costing

Component

About

A recipe costing studio with editable ingredient quantities, live plate cost, labour and overhead breakdown, a target-margin slider, suggested menu price, yield scaling, add and remove from a pantry, and animated totals.

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

Code

How Recipe Costing 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 {
  RecipeCosting,
  type PantryItem,
  type RecipeLine,
} from "@/components/ui/recipe-costing";

const PANTRY: PantryItem[] = [
  { id: "sweet-potato", name: "Sweet potato", unit: "g", packSize: 1000, packCost: 2.8, category: "produce" },
  { id: "red-lentils", name: "Red lentils", unit: "g", packSize: 500, packCost: 2.1, category: "pantry" },
  { id: "baby-spinach", name: "Baby spinach", unit: "g", packSize: 200, packCost: 2.6, category: "produce" },
  { id: "coconut-milk", name: "Coconut milk", unit: "ml", packSize: 400, packCost: 1.9, category: "pantry" },
  { id: "olive-oil", name: "Olive oil", unit: "ml", packSize: 500, packCost: 5.4, category: "pantry" },
  { id: "cumin", name: "Ground cumin", unit: "g", packSize: 100, packCost: 3.2, category: "spice" },
  { id: "yogurt", name: "Greek yogurt", unit: "g", packSize: 500, packCost: 3.4, category: "dairy" },
  { id: "pumpkin-seeds", name: "Pumpkin seeds", unit: "g", packSize: 250, packCost: 4.8, category: "pantry" },
  { id: "lime", name: "Lime", unit: "unit", packSize: 6, packCost: 1.5, category: "produce" },
  { id: "chicken-thigh", name: "Chicken thigh", unit: "g", packSize: 1000, packCost: 8.9, category: "protein" },
  { id: "feta", name: "Feta", unit: "g", packSize: 200, packCost: 3.9, category: "dairy" },
  { id: "smoked-paprika", name: "Smoked paprika", unit: "g", packSize: 75, packCost: 2.7, category: "spice" },
];

const LINES: RecipeLine[] = [
  { ingredientId: "sweet-potato", quantity: 620 },
  { ingredientId: "red-lentils", quantity: 220 },
  { ingredientId: "baby-spinach", quantity: 180 },
  { ingredientId: "coconut-milk", quantity: 200 },
  { ingredientId: "olive-oil", quantity: 32 },
  { ingredientId: "cumin", quantity: 8 },
  { ingredientId: "yogurt", quantity: 160 },
  { ingredientId: "pumpkin-seeds", quantity: 40 },
  { ingredientId: "lime", quantity: 2 },
];

export default function RecipeCostingDemo() {
  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-8 sm:px-6">
      <RecipeCosting
        pantry={PANTRY}
        initialLines={LINES}
        baseServings={4}
        laborCost={26}
        overheadRate={12}
        packagingPerServing={0.45}
        targetMargin={68}
        title="Spiced lentil bowl · costing sheet"
        description="A seasonal bowl for the lunch menu. Balance the plate cost against a healthy margin before it goes live."
      />
    </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.