A modern, animated, fully-responsive SaaS analytics dashboard built with Next.js 16, React 19, and Tailwind CSS v4.
Stacked area chart with 12-month revenue breakdown by source (subscriptions, one-time, ads).
4 key metrics (MRR, Active Users, Churn Rate, ARPU) with trend indicators and hover effects.
Weekly active users comparison chart and conversion funnel visualization.
Searchable customer data table with plan/status badges and formatted revenue.
Plan breakdown bar chart with revenue per tier (Free, Pro, Enterprise).
Persistent theme toggle with smooth transitions and OS preference detection.
Mobile navigation drawer, responsive grids, and touch-friendly interactions.
Smooth hover transitions, loading skeletons, and micro-interactions throughout.
Secure sign-in/sign-up with Clerk. Supports email/password, Google OAuth, and session management out of the box.
| Technology | Purpose |
|---|---|
| Next.js 16 | React framework with App Router & Server Components |
| React 19 | UI library with Server Components |
| Tailwind CSS v4 | Utility-first CSS framework |
| TypeScript | Type safety & developer experience |
| Recharts | Composable charting library |
| Lucide React | Clean, consistent icon library |
| Framer Motion | Animation library (ready for enhancements) |
| Clerk | Authentication (sign-in, sign-up, session management, Google OAuth) |
| date-fns | Date formatting utilities |
| shadcn/ui | Design system primitives (adapted) |
Add this dashboard to any existing Next.js project in 5 simple steps.
Run this command in your project root:
npm install recharts lucide-react framer-motion date-fns class-variance-authority clsx tailwind-merge @radix-ui/react-slot tailwindcss-animateCopy these folders into your project:
components/ # UI + Dashboard + Shared components
lib/ # Types, utilities, mock data
hooks/ # Custom React hooks
app/dashboard/ # Dashboard pages (protected)Ensure your app/globals.css has these Tailwind directives:
@import "tailwindcss";
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--font-sans: var(--font-geist-sans);
--font-mono: var(--font-geist-mono);
}
:root { --background: #ffffff; --foreground: #171717; }
.dark { --background: #0a0a0a; --foreground: #ededed; }
body {
background: var(--background);
color: var(--foreground);
font-synthesis: none;
}Edit lib/data.ts to replace mock data generators with your real API calls:
// Example: Replace mock data with your API
export async function getStatCards(): Promise<StatCardData[]> {
const res = await fetch("/api/dashboard/stats")
return res.json()
}The dashboard uses Clerk for authentication. To enable it:
clerk.com and create an application.env.local file with both keys# .env.local
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_your_key
CLERK_SECRET_KEY=sk_your_key
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard
NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboardAlternatively, remove the middleware.ts, ClerkProvider from layout.tsx, and Clerk imports from components to use the dashboard without auth.
Edit the indigo-* utility classes throughout the components to match your brand colors. The primary accent is indigo.
All chart colors are defined inline in the component files. Search for hex codes like #6366f1 to customize.
Add new pages by creating files in app/dashboard/. Update the sidebar navigation links in components/dashboard/sidebar.tsx.
The dashboard uses Clerk by default. To switch to another provider, update middleware.ts and app/layout.tsx. Sign-in/up pages are in app/(auth)/.
sass-dashboard/
āāā app/
ā āāā (dashboard)/ # Dashboard route group
ā ā āāā layout.tsx # Dashboard shell (sidebar + header)
ā ā āāā page.tsx # Overview page
ā ā āāā loading.tsx # Loading skeleton
ā ā āāā analytics/ # Analytics page
ā ā āāā customers/ # Customers page
ā ā āāā subscriptions/ # Subscriptions page
ā ā āāā settings/ # Settings page
ā āāā docs/ # Documentation page
ā āāā layout.tsx # Root layout (fonts, metadata)
ā āāā page.tsx # Landing page
ā āāā globals.css # Global styles & Tailwind
āāā components/
ā āāā ui/ # Primitive components
ā ā āāā avatar.tsx
ā ā āāā badge.tsx
ā ā āāā button.tsx
ā ā āāā card.tsx
ā āāā dashboard/ # Dashboard-specific widgets
ā ā āāā sidebar.tsx
ā ā āāā header.tsx
ā ā āāā stat-card.tsx
ā ā āāā revenue-chart.tsx
ā ā āāā recent-activity.tsx
ā ā āāā customer-table.tsx
ā ā āāā subscription-overview.tsx
ā ā āāā analytics-charts.tsx
ā ā āāā settings-form.tsx
ā āāā shared/ # Shared components
ā ā āāā theme-toggle.tsx
ā ā āāā mobile-nav.tsx
ā ā āāā loading-skeleton.tsx
ā āāā landing/ # Landing page components
āāā lib/ # Utilities & data
ā āāā types.ts
ā āāā utils.ts
ā āāā data.ts
āāā hooks/ # Custom hooksBuilt with Next.js 16, React 19 & Tailwind CSS v4. Codebuff