terra vidhal

Fleet Dispatch

Component

About

A fleet dispatch board with a priority queue, a combined utilisation summary, per-vehicle capacity checks, animated assignment and unassignment, auto-dispatch, load bars, a published route summary and reset.

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

Code

How Fleet Dispatch 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 {
  FleetDispatch,
  type DispatchJob,
  type DispatchVehicle,
} from "@/components/ui/fleet-dispatch";

const VEHICLES: DispatchVehicle[] = [
  { id: "v1", name: "Cargo van 12", plate: "FL-2841", driver: "Avery Cole", status: "available", capacity: 60 },
  { id: "v2", name: "Box truck 04", plate: "FL-5520", driver: "Jordan Pike", status: "loading", capacity: 90 },
  { id: "v3", name: "Cargo van 07", plate: "FL-1932", driver: "Riley Chen", status: "available", capacity: 55 },
  { id: "v4", name: "Box truck 02", plate: "FL-7714", driver: "Casey Moreno", status: "maintenance", capacity: 80 },
];

const JOBS: DispatchJob[] = [
  { id: "j1", code: "JOB-401", label: "Pallet of floor lamps", zone: "North loop", load: 24, priority: "high", window: "09:00–11:00" },
  { id: "j2", code: "JOB-402", label: "Returns collection", zone: "Depot A", load: 18, priority: "normal", window: "10:00–12:00" },
  { id: "j3", code: "JOB-403", label: "Seasonal display units", zone: "East loop", load: 32, priority: "normal", window: "11:00–14:00" },
  { id: "j4", code: "JOB-404", label: "Small parcel run", zone: "Zone 3", load: 9, priority: "low", window: "13:00–15:00" },
  { id: "j5", code: "JOB-405", label: "Urgent replacement parts", zone: "Zone 1", load: 12, priority: "high", window: "09:30–10:30" },
  { id: "j6", code: "JOB-406", label: "Bulk paper stock", zone: "Depot B", load: 28, priority: "low", window: "14:00–17:00" },
];

const ASSIGNMENTS: Record<string, string> = {
  j2: "v2",
};

export default function FleetDispatchDemo() {
  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">
      <FleetDispatch
        vehicles={VEHICLES}
        jobs={JOBS}
        initialAssignments={ASSIGNMENTS}
        title="Morning dispatch board"
      />
    </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.