Back to Dashboard

SaaS Dashboard Docs

A modern, animated, fully-responsive SaaS analytics dashboard built with Next.js 16, React 19, and Tailwind CSS v4.

✨ Features

Revenue Overview

Stacked area chart with 12-month revenue breakdown by source (subscriptions, one-time, ads).

Stat Cards

4 key metrics (MRR, Active Users, Churn Rate, ARPU) with trend indicators and hover effects.

Analytics Page

Weekly active users comparison chart and conversion funnel visualization.

Customer Table

Searchable customer data table with plan/status badges and formatted revenue.

Subscription Plans

Plan breakdown bar chart with revenue per tier (Free, Pro, Enterprise).

Dark/Light Mode

Persistent theme toggle with smooth transitions and OS preference detection.

Responsive Design

Mobile navigation drawer, responsive grids, and touch-friendly interactions.

Animations

Smooth hover transitions, loading skeletons, and micro-interactions throughout.

Authentication

Secure sign-in/sign-up with Clerk. Supports email/password, Google OAuth, and session management out of the box.

šŸ›  Tech Stack

TechnologyPurpose
Next.js 16React framework with App Router & Server Components
React 19UI library with Server Components
Tailwind CSS v4Utility-first CSS framework
TypeScriptType safety & developer experience
RechartsComposable charting library
Lucide ReactClean, consistent icon library
Framer MotionAnimation library (ready for enhancements)
ClerkAuthentication (sign-in, sign-up, session management, Google OAuth)
date-fnsDate formatting utilities
shadcn/uiDesign system primitives (adapted)

šŸ”Œ Integration Guide

Add this dashboard to any existing Next.js project in 5 simple steps.

1

Install Dependencies

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-animate
2

Copy the Files

Copy these folders into your project:

components/     # UI + Dashboard + Shared components
lib/            # Types, utilities, mock data
hooks/          # Custom React hooks
app/dashboard/            # Dashboard pages (protected)
3

Configure Tailwind CSS

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;
}
4

Replace Mock Data

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()
}
5

Add Authentication (Optional)

The dashboard uses Clerk for authentication. To enable it:

  1. Sign up at clerk.com and create an application
  2. Copy your Publishable Key and Secret Key
  3. Create a .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=/dashboard

Alternatively, remove the middleware.ts, ClerkProvider from layout.tsx, and Clerk imports from components to use the dashboard without auth.

šŸŽØ Customization Tips

Colors

Edit the indigo-* utility classes throughout the components to match your brand colors. The primary accent is indigo.

Charts

All chart colors are defined inline in the component files. Search for hex codes like #6366f1 to customize.

Pages

Add new pages by creating files in app/dashboard/. Update the sidebar navigation links in components/dashboard/sidebar.tsx.

Auth Provider

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)/.

šŸ“ File Structure

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 hooks

Built with Next.js 16, React 19 & Tailwind CSS v4. Codebuff