terra vidhal

Crop Rotation Planner

Component

About

A crop rotation planner with a plot-by-season grid, a crop library of families and nitrogen effects, click-to-plant cells, arrow-key navigation, family and heavy-feeder warnings, soil balance, an auto-plan generator and progress stats.

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

Code

How Crop Rotation 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 {
  CropRotationPlanner,
  type RotationCrop,
  type RotationPlot,
  type RotationSeason,
} from "@/components/ui/crop-rotation-planner";

const PLOTS: RotationPlot[] = [
  { id: "north", name: "North bed", area: 1.2 },
  { id: "east", name: "East bed", area: 0.9 },
  { id: "south", name: "South bed", area: 1.4 },
  { id: "west", name: "West bed", area: 0.8 },
];

const SEASONS: RotationSeason[] = [
  { id: "spring", label: "Spring" },
  { id: "summer", label: "Summer" },
  { id: "autumn", label: "Autumn" },
  { id: "winter", label: "Winter" },
];

const CROPS: RotationCrop[] = [
  { id: "fava", name: "Fava beans", family: "legume", kind: "legume", nitrogen: 35, days: 180 },
  { id: "peas", name: "Field peas", family: "legume", kind: "legume", nitrogen: 30, days: 150 },
  { id: "cabbage", name: "Cabbage", family: "brassica", kind: "heavy", nitrogen: -15, days: 120 },
  { id: "broccoli", name: "Broccoli", family: "brassica", kind: "heavy", nitrogen: -15, days: 110 },
  { id: "carrot", name: "Carrot", family: "root", kind: "light", nitrogen: -10, days: 100 },
  { id: "beetroot", name: "Beetroot", family: "root", kind: "light", nitrogen: -10, days: 90 },
  { id: "oats", name: "Oats", family: "grain", kind: "light", nitrogen: -20, days: 140 },
  { id: "barley", name: "Barley", family: "grain", kind: "light", nitrogen: -20, days: 130 },
  { id: "spinach", name: "Spinach", family: "leafy", kind: "heavy", nitrogen: -8, days: 60 },
  { id: "squash", name: "Squash", family: "fruit", kind: "heavy", nitrogen: -12, days: 120 },
];

const INITIAL: Record<string, string> = {
  "north:spring": "fava",
  "north:summer": "cabbage",
  "north:autumn": "carrot",
  "north:winter": "oats",
  "east:spring": "peas",
  "east:summer": "broccoli",
  "east:autumn": "beetroot",
  "east:winter": "barley",
  "south:spring": "cabbage",
  "south:summer": "broccoli",
  "south:autumn": "spinach",
  "south:winter": "oats",
  "west:spring": "carrot",
  "west:summer": "squash",
  "west:winter": "peas",
};

export default function CropRotationPlannerDemo() {
  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">
      <CropRotationPlanner
        plots={PLOTS}
        crops={CROPS}
        seasons={SEASONS}
        initialAssignments={INITIAL}
        title="Market garden · four-season rotation"
        description="Keep the beds productive without repeating plant families. Fix nitrogen with legumes and spot tired soil before it costs a harvest."
      />
    </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.