The whole dashboard installs with one shadcn command. It writes 23 files — routes, shell, data and components — and the source stays yours to edit.
Run this in a project that already uses shadcn/ui on React and Tailwind CSS v4.
npx shadcn@latest add https://prequelui.terravidhal.me/r/origin.json"use client";
import { useEffect, useState } from "react";
import { AnimatePresence, motion, useReducedMotion } from "motion/react";
import { ChevronRight, Download } from "lucide-react";
import { ActivityHeatmap } from "@/components/activity-heatmap";
import { KpiCounter } from "@/components/kpi-counter";
import {
customerActivity,
customerKpis,
customers,
} from "@/dashboards/origin/data";
import { CustomerPanel } from "@/dashboards/origin/components/customer-panel";
import { CustomersTable } from "@/dashboards/origin/components/customers-table";
import {
ChartCardSkeleton,
KpiRowSkeleton,
ListCardSkeleton,
TableSkeleton,
} from "@/dashboards/origin/skeletons";
import {
Avatar,
EASE,
PageHeader,
Panel,
RefreshButton,
downloadCsv,
} from "@/dashboards/origin/ui";
import { useRefresh } from "@/dashboards/origin/use-refresh";
import { cn } from "@/lib/utils";
function CustomersSkeleton() {
return (
<div className="space-y-4">
<KpiRowSkeleton />
<div className="grid grid-cols-1 gap-4 min-[1400px]:grid-cols-12 min-[1400px]:items-start">
<TableSkeleton className="min-[1400px]:col-span-8" columns={7} rows={8} />
<ListCardSkeleton className="min-[1400px]:col-span-4" rows={4} />
</div>
<div className="grid grid-cols-1 gap-4 min-[1400px]:grid-cols-12 min-[1400px]:items-start">
<ChartCardSkeleton className="min-[1400px]:col-span-8" height="h-44" />
<ListCardSkeleton className="min-[1400px]:col-span-4" rows={4} />
</div>
</div>
);
}
function healthClass(health: number) {
if (health >= 70) return "bg-success";
if (health >= 50) return "bg-chart-3";
return "bg-destructive";
}
export default function CustomersPage() {
const reduce = Boolean(useReducedMotion());
const { refreshing, refresh } = useRefresh();
const [selectedId, setSelectedId] = useState(customers[0].id);
const [drawerOpen, setDrawerOpen] = useState(false);
const selected = customers.find((customer) => customer.id === selectedId) ?? customers[0];
const attention = customers.filter((customer) => customer.status === "at-risk");
useEffect(() => {
if (!drawerOpen) return;
const previous = document.body.style.overflow;
document.body.style.overflow = "hidden";
const handleKey = (event: KeyboardEvent) => {
if (event.key === "Escape") setDrawerOpen(false);
};
document.addEventListener("keydown", handleKey);
return () => {
document.body.style.overflow = previous;
document.removeEventListener("keydown", handleKey);
};
}, [drawerOpen]);
const selectCustomer = (id: string) => {
setSelectedId(id);
if (
typeof window !== "undefined" &&
!window.matchMedia("(min-width: 1400px)").matches
) {
setDrawerOpen(true);
}
};
return (
<div className="space-y-5">
<PageHeader
title="Customers"
description="1,284 accounts · search, sort and inspect any customer"
badge={
<span className="inline-flex items-center rounded-full border border-border px-2 py-0.5 text-[11.5px] font-medium tabular-nums text-muted-foreground">
19 in view
</span>
}
actions={
<>
<button
type="button"
onClick={() =>
downloadCsv(
"origin-customers.csv",
["Customer", "Email", "Plan", "Status", "Seats", "MRR", "Health", "Renewal", "Owner"],
customers.map((customer) => [
customer.name,
customer.email,
customer.plan,
customer.status,
customer.seats,
customer.mrr,
customer.health,
customer.renewal,
customer.owner,
])
)
}
className="inline-flex h-9 items-center gap-2 rounded-lg border border-input bg-card px-3 text-[13px] font-medium shadow-sm transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
>
<Download className="h-3.5 w-3.5" />
Export
</button>
<RefreshButton refreshing={refreshing} onClick={refresh} />
</>
}
/>
{refreshing ? (
<CustomersSkeleton />
) : (
<div className="space-y-4">
<KpiCounter
items={customerKpis}
className="lg:grid-cols-2 xl:grid-cols-4"
/>
<div className="grid grid-cols-1 gap-4 min-[1400px]:grid-cols-12">
<CustomersTable
className="min-[1400px]:col-span-8"
selectedId={selectedId}
onSelect={selectCustomer}
/>
<div className="hidden min-[1400px]:col-span-4 min-[1400px]:block">
<div className="xl:sticky xl:top-16">
<CustomerPanel key={selected.id} customer={selected} />
</div>
</div>
</div>
<div className="grid grid-cols-1 gap-4 min-[1400px]:grid-cols-12 min-[1400px]:items-start">
<ActivityHeatmap
className="min-[1400px]:col-span-8"
title="Customer activity"
description="Daily active seats across the workspace, last 26 weeks."
values={customerActivity}
unitLabel="active seats"
/>
<Panel className="min-[1400px]:col-span-4">
<div className="flex items-start justify-between gap-3 p-5 pb-0">
<div>
<h2 className="text-[15px] font-semibold tracking-tight">
Needs attention
</h2>
<p className="mt-0.5 text-[13px] text-muted-foreground">
At-risk accounts to review this week
</p>
</div>
<span className="inline-flex items-center rounded-full border border-destructive/25 bg-destructive/10 px-2 py-0.5 text-[11px] font-medium tabular-nums text-destructive">
{attention.length}
</span>
</div>
<ul className="p-3 pt-3">
{attention.map((customer) => (
<li key={customer.id}>
<button
type="button"
onClick={() => selectCustomer(customer.id)}
className={cn(
"flex w-full items-center gap-3 rounded-lg p-2 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
customer.id === selectedId
? "bg-accent"
: "hover:bg-muted/50"
)}
>
<Avatar name={customer.name} />
<div className="min-w-0 flex-1">
<div className="truncate text-[13px] font-medium">
{customer.name}
</div>
<div className="mt-1 flex items-center gap-2">
<div className="h-1.5 w-16 overflow-hidden rounded-full bg-muted">
<div
className={cn(
"h-full rounded-full",
healthClass(customer.health)
)}
style={{ width: `${customer.health}%` }}
/>
</div>
<span className="text-[10.5px] tabular-nums text-muted-foreground">
Health {customer.health}
</span>
</div>
</div>
<div className="shrink-0 text-right">
<div className="text-[12px] font-medium tabular-nums">
${customer.mrr.toLocaleString("en-US")}
</div>
<div className="text-[10.5px] text-muted-foreground">
MRR
</div>
</div>
<ChevronRight
className="h-4 w-4 shrink-0 text-muted-foreground/60"
aria-hidden="true"
/>
</button>
</li>
))}
</ul>
<div className="border-t border-border px-5 py-3 text-[11.5px] text-muted-foreground">
Renewals in the next 30 days ·{" "}
<span className="font-medium text-foreground">$12.4k</span>
</div>
</Panel>
</div>
</div>
)}
<AnimatePresence>
{drawerOpen ? (
<div className="fixed inset-0 z-50 min-[1400px]:hidden">
<motion.button
type="button"
aria-label="Close customer panel"
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
transition={{ duration: 0.2 }}
onClick={() => setDrawerOpen(false)}
className="absolute inset-0 bg-background/60 backdrop-blur-sm"
/>
<motion.div
role="dialog"
aria-modal="true"
aria-label={`${selected.name} details`}
initial={{ x: "100%" }}
animate={{ x: 0 }}
exit={{ x: "100%" }}
transition={{ type: "tween", duration: reduce ? 0 : 0.34, ease: EASE }}
className="absolute inset-y-0 right-0 w-[min(92vw,420px)] overflow-y-auto border-l border-border bg-background p-3 shadow-2xl"
>
<CustomerPanel
key={selected.id}
customer={selected}
onClose={() => setDrawerOpen(false)}
/>
</motion.div>
</div>
) : null}
</AnimatePresence>
</div>
);
}
motion, lucide-react
npm install motion lucide-reactThese come from the free MIT registry and are installed with the dashboard.
The routes and the data are ordinary files in your app; change them like your own.
The dashboard mounts at /dashboards/origin. Every screen listed above is its own route under app/dashboards/origin.
The numbers, names and dates come from dashboards/origin/data.ts. Keep the exported shapes and every chart, table and filter keeps working.
Navigation, command search, notifications and the theme switch live in the shell. The switch reads PrequelUI's ThemeProvider, so wrap your root layout in it or point the switch at your own.
Free and MIT. Read the dashboard guide for project requirements and the manual install.