Next.js Tailwind Admin Dashboard with Dark Mode - Shadcn Dashboard
A starter admin dashboard built with Next.js, shadcn/ui and Tailwind CSS, featuring dark mode and authentication.
By Kiranism kiranism/next-shadcn-dashboard-starter 7,345 stars
Introduction
Shadcn Dashboard is an open‑source starter template for building admin panels. It uses Next.js 16, Tailwind CSS v4, shadcn/ui components and TypeScript. The template includes dark mode, authentication with Clerk, data tables, charts, drag‑and‑drop, keyboard shortcuts and a responsive layout.
What this project offers
- A ready‑made dashboard layout with sidebar, header and content area.
- Dark‑mode support that follows the system preference.
- Authentication and user management powered by Clerk.
- Real‑working data tables with sorting, filtering, pagination and React Query caching.
- Charts built with Recharts.
- Drag‑and‑drop UI built with dnd‑kit.
- Keyboard command palette via kbar.
- Theme switcher with several built‑in themes.
Main features
- Dark Mode
- Clerk authentication (including organizations)
- React Table with server pre‑fetch and client cache
- Recharts visualisations
- dnd‑kit drag‑and‑drop
- kbar command palette
- Responsive design for desktop and mobile
- Server‑side rendering is disabled (client‑only)
- Full TypeScript support
Technology stack
- Framework: Next.js 16
- Language: TypeScript 5.7
- Styling: Tailwind CSS v4, Tailwind‑merge, tailwindcss‑animate
- UI components: shadcn/ui on Base UI primitives
- State & data: React 19, React Query 5, TanStack Table, TanStack Form, Zod, Zustand (via dependencies)
- Auth: Clerk
- Charts: Recharts
- Drag‑and‑drop: dnd‑kit
- Command palette: kbar
- Build tools: oxlint, oxfmt, Husky (pre‑commit)
Requirements
- Node.js 18 or newer
- npm or bun (both are supported by the scripts)
Installation
- Download the starter
# The ZIP file is provided at /download/shadcn-dashboard.zip
# Save it to a convenient folder and unzip
unzip shadcn-dashboard.zip -d shadcn-dashboard
cd shadcn-dashboard
- Install dependencies
# Using npm
npm install
# Or, if you prefer bun
bun install
- Run the post‑install script and start development server
# This runs a small setup script and then starts Next.js in dev mode
npm run dev
# or with bun
bun run dev
- Build the production version
npm run build
# or
bun run build
The build creates a .next directory that contains the compiled server and static assets.
- Start the production server
npm start
# or
bun start
The app will be available at http://localhost:3000.
Configuration
- Environment variables are defined in
env.example.txt. Copy it to.env.localand fill in the required values (Clerk keys, Sentry settings, etc.). - The Tailwind configuration lives in
tailwind.config.ts(generated by the framework). - Next.js settings are in
next.config.ts; you can adjust output mode, image domains, or enable/disable Sentry here.
Customizing the project
- Themes: Edit files under
src/components/themes/or add new theme files insrc/styles/themes/. - Navigation: Menu items are defined in
src/config/nav-config.ts. Modify this file to add or remove pages. - Features: The
src/features/folder contains feature‑based modules (auth, chat, kanban, etc.). Remove a folder you do not need, then run the cleanup script (node scripts/cleanup.js) to strip related code. - Styling: Global styles are in
src/styles/globals.css. Tailwind utility classes can be used throughout the JSX/TSX files.
Project structure
.
├─ public/
│ └─ shadcn-dashboard.png
├─ src/
│ ├─ app/ # Next.js route handlers and pages
│ ├─ components/ # UI components (nav, modal, icons, etc.)
│ ├─ config/ # Table, navigation and other config objects
│ ├─ features/ # Feature modules (auth, chat, kanban, …)
│ ├─ hooks/ # Custom React hooks
│ ├─ lib/ # Utility libraries (api client, query client, …)
│ └─ styles/ # Tailwind CSS files
├─ scripts/
│ └─ postinstall.js # Runs after npm install
├─ next.config.ts
├─ tailwind.config.ts
├─ package.json
└─ tsconfig.json
Tips
- Development: The
devscript runsnext devafter the post‑install step, giving hot‑module reloading. - Linting & formatting: Use
npm run lintandnpm run formatto keep code consistent. - Cleaning unused code: The repository includes a cleanup script (
scripts/cleanup.js) that can remove entire feature folders you don’t need. - Deploying: After building, you can deploy the
.nextfolder with a Node.js runtime (Vercel, Render, Railway, etc.). The template is not a static HTML site; it requires a server to run the Next.js runtime.
License and attribution
The project is licensed under the MIT License. See the LICENSE file in the repository.
Original repository: https://github.com/kiranism/next-shadcn-dashboard-starter
When redistributing, keep the license file and credit the author as required by the MIT terms.
Use this prompt with an AI coding assistant (Claude Code, Cursor, Copilot, ChatGPT and similar).
- Download the ZIP and extract it where your new project will live.
- Download the ZIP and extract it next to your project, so the assistant can read both.
- Fill in the bracketed parts under “About my project”.
- Paste the prompt into your assistant and review each change it proposes.
# Start a new project with Shadcn Dashboard ## Your task You are a senior frontend engineer. We are building a new project using Shadcn Dashboard, a starter template built with Tailwind CSS 4, as the starting point. Keep its design and turn the demo into a clean, real codebase that I can maintain. ## About my project - What I'm building and for whom: [describe it] - Pages I need: [list them] - Stack: [keep it as it is, with its own build, or name one: Vite / Laravel / Next.js / Astro] - Brand: [name, colours, fonts, logo] # Shadcn Dashboard — project brief ## Source project Shadcn Dashboard is a starter admin dashboard built with Next.js 16, shadcn/ui and Tailwind CSS v4. It includes dark‑mode support, authentication via Clerk, and a feature‑rich layout. Repository: https://github.com/kiranism/next-shadcn-dashboard-starter – MIT license, author credited in LICENSE. ## Files that matter - **Pages (src/app)** - `page.tsx` – entry page (home/dashboard). - `about/page.tsx` – about page. - `auth/…` – Clerk authentication routes (sign‑in, sign‑up, callback). - `dashboard/…` – main dashboard sections (overview, analytics, tables, etc.). - `privacy-policy/page.tsx` and `terms-of-service/page.tsx` – legal pages. - `api/…` – API route stubs. - **Layout** – `src/app/layout.tsx` provides the global shell (sidebar, header, theme provider). - **Stylesheets** – `src/styles/globals.css`, `src/styles/theme.css`, and files under `src/styles/themes/`. - **Scripts** – npm scripts in `package.json` (`dev`, `build`, `start`, `lint`, `format`, etc.). - **Images & fonts** – `public/shadcn-dashboard.png`, `public/next.svg`, `public/assets/sentry.svg`. - **Configuration** – `next.config.ts`, `postcss.config.js`, `tsconfig.json`, `tailwind.config.js` (implicitly via Tailwind v4). - **Components** – UI pieces under `src/components/` (navigation, modals, forms, tables, icons, kbar, etc.). - **Feature modules** – code under `src/features/` (auth, chat, kanban, overview, products, profile, users, etc.). - **Hooks & utilities** – `src/hooks/` and `src/lib/` provide data‑fetching, table helpers, and other shared logic. ## Setup and build The project requires a build step. Run the following commands in the repository root: ```bash # Install dependencies (npm or bun) npm install # or: bun install # Development server npm run dev # runs postinstall script then starts Next.js dev mode # Production build npm run build # creates .next output # Start the production server npm run start # serves the built .next directory ``` Only the scripts listed in `package.json` are available. ## How it is put together The dashboard uses a **layout component** (`src/app/layout.tsx`) that wraps every page with a persistent sidebar, top header, and theme provider (`next-themes`). The sidebar navigation is generated from `src/config/nav-config.ts` and filtered by Clerk organization/role data. Each page imports **shadcn/ui** components (via Base UI primitives) and Tailwind utility classes. Common UI patterns (tables, forms, modals, dropdowns) are encapsulated in `src/components/` and reused across pages. Data fetching relies on **TanStack React Query** (`@tanstack/react-query`) with server‑side prefetching and client‑side cache hydration. Tables use `@tanstack/react-table` and custom hooks (`use-data-table.tsx`). Charts are rendered with **Recharts** (`recharts`). Drag‑and‑drop features use **dnd‑kit**. Keyboard command palette is powered by **kbar**. Theme values (colors, fonts, spacing) are defined in Tailwind’s configuration and the `src/styles/theme.css` file. Dark mode is toggled via `next-themes` and respects the `class` strategy, applying a `dark` class to the root HTML element. No RTL support is configured. ## Watch out for 1. **Tailwind v4 vs older docs** – class names and configuration differ from Tailwind v3; ensure any custom utilities follow the v4 syntax. 2. **Clerk environment variables** – authentication components expect Clerk keys (`NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY`, `CLERK_SECRET_KEY`). Missing variables cause runtime errors. 3. **React 19 compatibility** – the project uses React 19; older third‑party components may assume React 18 APIs. 4. **Sentry integration** – `next.config.ts` conditionally adds Sentry; if `NEXT_PUBLIC_SENTRY_DISABLED` is not set, the build will attempt to upload source maps. Disable or configure correctly to avoid build failures. 5. **Global CSS in `globals.css`** – Tailwind’s preflight resets many base styles; custom global rules may unintentionally affect third‑party components. 6. **Duplicate script execution** – the `dev` script runs `scripts/postinstall.js` before starting Next.js; removing it without adjusting imports can break dynamic imports used by the cleanup scripts. ## Verify - [ ] Home/dashboard (`src/app/page.tsx`) renders without console errors. - [ ] Sidebar navigation displays correctly and respects Clerk organization/role filtering. - [ ] Dark‑mode toggle switches theme and persists across pages. - [ ] Recharts components on the overview page render and respond to data changes. - [ ] Data tables (React Table) support sorting, filtering, pagination, and show loading states. - [ ] Clerk authentication flows (sign‑in, sign‑up, sign‑out) work and redirect as expected. - [ ] No duplicate loading of Tailwind or other CSS frameworks in the network tab. - [ ] Production build (`npm run build`) completes without Sentry configuration errors when Sentry is disabled. # How to work ## Step 1 — Get it running as it is Start from the downloaded ZIP or a clone of the repository. Install the dependencies and start the dev server with the exact commands in "Setup and build" above. Confirm it runs without console errors before changing anything. ## Step 2 — Plan the project with me List the pages and sections of Shadcn Dashboard to keep, rename or remove for my project, the folder structure you propose for my stack, and where the repeated parts will live. Wait for my OK. ## Step 3 — Build it - Keep the pages I need, remove the rest, and replace the sample content with real content. - Extract repeated parts (header, navigation, footer) into shared partials or components. - Put my brand name, colours and fonts where Shadcn Dashboard defines its theme (see "How it is put together" above), not as one-off overrides. - Keep Tailwind CSS's markup patterns and class conventions so the design stays consistent, and don't change its major version unless I ask. - Keep dark mode working on every page you touch. ## Step 4 — Polish and launch - Remove demo content and every CSS/JS file nothing uses any more; optimise images. - Check phone, tablet and desktop widths, labels, alt text, keyboard focus and colour contrast. - Run the production build and tell me which folder to deploy. - Keep the license file and credit the author of Shadcn Dashboard. ## Ground rules Work in small steps and show me each change. Use only the libraries already in the project unless I agree to add one.



