Skip to content

Dashboards · React · Featured

Analytics dashboard

A responsive dashboard layout with sidebar navigation, stat cards, and a data table.
Analytics dashboard starter, as built from its own files
Starter screenshot captured from this template's own build at 1440×900. It shows the template as it ships, not output generated from a prompt.

What you get

A sidebar + content dashboard shell with stat cards, a dependency-free SVG revenue chart, a plan-mix breakdown and a searchable customer table backed by an in-memory array. Swap the array for a fetch call to your API and the table keeps working. Uses CSS grid for the responsive layout, so it collapses to a single column on phones.

Files, exactly as copied.

Exactly what is copied into a new project: 11 files, nothing generated.

Raw data: GET /api/v1/templates/vite-react-dashboard

src/App.tsx
src/App.tsx
import { useMemo, useState } from "react";import { AreaChart, Sparkline } from "./Chart";import { months, revenue, rows, type Plan, type Status } from "./data"; const nav = [  { label: "Overview", icon: "M3 12l9-8 9 8M5 10v10h14V10" },  { label: "Customers", icon: "M16 19v-1a4 4 0 00-4-4H8a4 4 0 00-4 4v1M10 10a3 3 0 100-6 3 3 0 000 6zM20 19v-1a3 3 0 00-2-2.8M16 4.2a3 3 0 010 5.6" },  { label: "Revenue", icon: "M4 19h16M7 15v-4M12 15V7M17 15v-6" },  { label: "Reports", icon: "M7 3h7l5 5v13H7zM14 3v5h5M10 13h6M10 17h6" },  { label: "Settings", icon: "M12 15a3 3 0 100-6 3 3 0 000 6zM19.4 15a1.7 1.7 0 00.3 1.8l.1.1a2 2 0 11-2.8 2.8l-.1-.1a1.7 1.7 0 00-1.8-.3 1.7 1.7 0 00-1 1.5V21a2 2 0 11-4 0v-.1a1.7 1.7 0 00-1.1-1.5 1.7 1.7 0 00-1.8.3l-.1.1a2 2 0 11-2.8-2.8l.1-.1a1.7 1.7 0 00.3-1.8 1.7 1.7 0 00-1.5-1H3a2 2 0 110-4h.1a1.7 1.7 0 001.5-1.1 1.7 1.7 0 00-.3-1.8l-.1-.1a2 2 0 112.8-2.8l.1.1a1.7 1.7 0 001.8.3H9a1.7 1.7 0 001-1.5V3a2 2 0 114 0v.1a1.7 1.7 0 001 1.5 1.7 1.7 0 001.8-.3l.1-.1a2 2 0 112.8 2.8l-.1.1a1.7 1.7 0 00-.3 1.8V9a1.7 1.7 0 001.5 1H21a2 2 0 110 4h-.1a1.7 1.7 0 00-1.5 1z" },]; const planTone: Record<Plan, string> = { Free: "bg-slate-100 text-slate-700", Pro: "bg-blue-50 text-blue-700", Team: "bg-blue-50 text-blue-700" };const statusTone: Record<Status, string> = { active: "bg-emerald-500", trialing: "bg-amber-400", churned: "bg-rose-400" };const avatarTone = ["bg-blue-100 text-blue-700", "bg-emerald-100 text-emerald-700", "bg-amber-100 text-amber-800", "bg-rose-100 text-rose-700", "bg-sky-100 text-sky-700"]; const inr = (n: number) => "₹" + n.toLocaleString("en-IN"); function Icon({ d }: { d: string }) {  return (    <svg viewBox="0 0 24 24" className="h-4 w-4" fill="none" stroke="currentColor" strokeWidth={1.8} strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">      <path d={d} />    </svg>  );} export default function App() {  const [query, setQuery] = useState("");  const filtered = useMemo(() => rows.filter((r) => r.customer.toLowerCase().includes(query.toLowerCase())), [query]);  const active = rows.filter((r) => r.status === "active");  const mrr = active.reduce((s, r) => s + r.mrr, 0);  const growth = ((revenue[revenue.length - 1] - revenue[revenue.length - 4]) / revenue[revenue.length - 4]) * 100;  const plans: Plan[] = ["Team", "Pro", "Free"];  const stats = [    { label: "Active customers", value: String(active.length), trend: [3, 3, 4, 4, 5, 5, active.length] },    { label: "Monthly revenue", value: inr(mrr), trend: revenue.slice(-7) },    { label: "Trials", value: String(rows.filter((r) => r.status === "trialing").length), trend: [1, 2, 1, 3, 2, 2, 2] },    { label: "Churned", value: String(rows.filter((r) => r.status === "churned").length), trend: [2, 2, 1, 1, 1, 1, 1], tone: "rgb(244 63 94)" },  ];   return (    <div className="min-h-screen bg-slate-50 text-slate-900 md:grid md:grid-cols-[232px_1fr]">      <aside className="flex flex-col border-b border-slate-200 bg-white px-4 py-5 md:border-b-0 md:border-r">        <div className="flex items-center gap-2.5 px-2">          <span className="grid h-8 w-8 place-items-center rounded-lg bg-gradient-to-br from-blue-500 to-blue-500 text-sm font-bold text-white shadow-sm">A</span>          <div className="leading-tight">            <div className="text-sm font-semibold">Acme Analytics</div>            <div className="text-xs text-slate-500">Production</div>          </div>        </div>        <nav className="mt-8 space-y-0.5 text-sm" aria-label="Main">          {nav.map((item, i) => (            <a              key={item.label}              href="#"              aria-current={i === 0 ? "page" : undefined}              className={"flex items-center gap-3 rounded-lg px-3 py-2 transition " + (i === 0 ? "bg-slate-900 font-medium text-white shadow-sm" : "text-slate-600 hover:bg-slate-100 hover:text-slate-900")}            >              <Icon d={item.icon} />              {item.label}            </a>          ))}        </nav>        <div className="mt-auto hidden rounded-xl border border-slate-200 bg-slate-50 p-3 md:block">          <div className="text-xs font-medium">Sample data</div>          <p className="mt-1 text-xs leading-relaxed text-slate-500">Replace src/data.ts with your API to see real numbers.</p>        </div>      </aside>       <main className="min-w-0 p-6 lg:p-8">        <header className="flex flex-wrap items-end justify-between gap-4">          <div>            <p className="text-sm text-slate-500">Last 12 months</p>            <h1 className="mt-1 text-2xl font-semibold tracking-tight">Overview</h1>          </div>          <div className="flex items-center gap-2">            <div className="flex rounded-lg border border-slate-200 bg-white p-0.5 text-xs font-medium shadow-sm" role="group" aria-label="Range">              {["7d", "30d", "12m"].map((r) => (                <span key={r} className={"rounded-md px-2.5 py-1.5 " + (r === "12m" ? "bg-slate-900 text-white" : "text-slate-500")}>                  {r}                </span>              ))}            </div>            <button type="button" className="rounded-lg border border-slate-200 bg-white px-3 py-2 text-xs font-medium shadow-sm hover:bg-slate-50">              Export CSV            </button>          </div>        </header>         <div className="mt-6 grid gap-4 sm:grid-cols-2 xl:grid-cols-4">          {stats.map((s) => (            <div key={s.label} className="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm">              <div className="text-sm text-slate-500">{s.label}</div>              <div className="mt-2 flex items-end justify-between gap-2">                <div className="text-2xl font-semibold tracking-tight">{s.value}</div>                <Sparkline values={s.trend} tone={s.tone} />              </div>            </div>          ))}        </div>         <div className="mt-4 grid gap-4 xl:grid-cols-[minmax(0,1fr)_320px]">          <section className="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm" aria-labelledby="mrr-heading">            <div className="flex items-start justify-between">              <div>                <h2 id="mrr-heading" className="text-sm font-medium text-slate-500">Monthly recurring revenue</h2>                <p className="mt-1 text-2xl font-semibold tracking-tight">{inr(revenue[revenue.length - 1])}</p>              </div>              <span className="rounded-full bg-emerald-50 px-2 py-1 text-xs font-medium text-emerald-700">+{growth.toFixed(1)}% in 3 months</span>            </div>            <div className="mt-4">              <AreaChart values={revenue} labels={months} />            </div>          </section>          <section className="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm" aria-labelledby="mix-heading">            <h2 id="mix-heading" className="text-sm font-medium text-slate-500">Plan mix</h2>            <ul className="mt-5 space-y-5">              {plans.map((p) => {                const count = rows.filter((r) => r.plan === p).length;                return (                  <li key={p}>                    <div className="flex items-center justify-between text-sm">                      <span className="font-medium">{p}</span>                      <span className="text-slate-500">{count} customers</span>                    </div>                    <div className="mt-2 h-2 rounded-full bg-slate-100">                      <div className={"h-2 rounded-full " + (p === "Team" ? "bg-blue-500" : p === "Pro" ? "bg-blue-500" : "bg-slate-300")} style={{ width: (count / rows.length) * 100 + "%" }} />                    </div>                  </li>                );              })}            </ul>            <p className="mt-6 border-t border-slate-100 pt-4 text-xs text-slate-500">Paid plans make up {Math.round((rows.filter((r) => r.plan !== "Free").length / rows.length) * 100)}% of accounts.</p>          </section>        </div>         <section className="mt-4 rounded-2xl border border-slate-200 bg-white shadow-sm" aria-labelledby="customers-heading">          <div className="flex flex-wrap items-center justify-between gap-3 border-b border-slate-200 px-5 py-4">            <h2 id="customers-heading" className="font-medium">              Customers <span className="ml-1 text-sm font-normal text-slate-400">{filtered.length}</span>            </h2>            <input value={query} onChange={(e) => setQuery(e.target.value)} placeholder="Search customers…" className="w-56 rounded-lg border border-slate-200 bg-slate-50 px-3 py-1.5 text-sm outline-none focus:border-blue-400 focus:bg-white" aria-label="Search customers" />          </div>          <div className="overflow-x-auto">            <table className="w-full text-sm">              <thead className="text-left text-xs uppercase tracking-wide text-slate-400">                <tr>                  <th className="px-5 py-3 font-medium">Customer</th>                  <th className="px-5 py-3 font-medium">Plan</th>                  <th className="px-5 py-3 text-right font-medium">MRR</th>                  <th className="px-5 py-3 font-medium">Status</th>                  <th className="px-5 py-3 font-medium">Joined</th>                </tr>              </thead>              <tbody>                {filtered.map((r) => (                  <tr key={r.id} className="border-t border-slate-100 transition hover:bg-slate-50">                    <td className="px-5 py-3">                      <div className="flex items-center gap-3">                        <span className={"grid h-8 w-8 place-items-center rounded-full text-xs font-semibold " + avatarTone[r.id % avatarTone.length]}>{r.customer.slice(0, 2).toUpperCase()}</span>                        <div>                          <div className="font-medium">{r.customer}</div>                          <div className="text-xs text-slate-500">{r.email}</div>                        </div>                      </div>                    </td>                    <td className="px-5 py-3">                      <span className={"rounded-md px-2 py-0.5 text-xs font-medium " + planTone[r.plan]}>{r.plan}</span>                    </td>                    <td className="px-5 py-3 text-right tabular-nums">{inr(r.mrr)}</td>                    <td className="px-5 py-3">                      <span className="inline-flex items-center gap-2 capitalize text-slate-600">                        <span className={"h-2 w-2 rounded-full " + statusTone[r.status]} />                        {r.status}                      </span>                    </td>                    <td className="px-5 py-3 text-slate-500">{new Date(r.joined).toLocaleDateString("en-IN", { day: "numeric", month: "short", year: "numeric" })}</td>                  </tr>                ))}              </tbody>            </table>            {filtered.length === 0 ? <p className="px-5 py-10 text-center text-sm text-slate-500">No customers match “{query}”.</p> : null}          </div>        </section>      </main>    </div>  );}

Remix

Remix this template.

Describe what to change and the agent starts from Analytics dashboard's files. The box is already started for you: finish “Start from Analytics dashboard and …”

Agent ready

Creates a free account first; your idea is carried over.

Dependencies

Documented from the template's package.json. The runtime has a prebuilt dependency set for Vite + React + TypeScript, so installs are fast.

  • react^19.1.0
  • react-dom^19.1.0
  • vite^6.3.0
  • @vitejs/plugin-react^4.4.0
  • tailwindcss^4.1.0
  • @tailwindcss/vite^4.1.0
  • typescript^5.8.0

How it runs

Framework
Vite + React + TypeScript
Dev command
npm run dev
Build command
npm run build
Output directory
dist
Port
5173
Entry route
/

Projects run in an isolated sandbox with a live preview. Read the projects documentation for settings, snapshots and deployment.

All templates

Build on Analytics dashboard

Create a free account, start from this template, and ask the AI agent to turn it into your app.