React Next.js 16 Starter with Tailwind CSS 4 - Nextjs Nextra Starter
A starter template for Next.js 16 with Tailwind CSS 4, Nextra 4, Shadcn UI and Radix UI. Includes docs, blog, AI SaaS landing page, dark mode and i18n.
By pdsuwwz pdsuwwz/nextjs-nextra-starter 319 stars
Introduction
Nextjs Nextra Starter is a starter template for building documentation‑driven sites with Next.js 16, React 19, TypeScript, and Tailwind CSS 4. It includes ready‑made pages for docs, a blog, and an AI SaaS landing page, and supports dark mode, i18n, and UI libraries such as Shadcn UI and Radix UI.
What this project offers
- A complete Next.js application configured for content‑driven sites.
- Integrated Tailwind CSS 4 with Sass support.
- Documentation and blog sections powered by Nextra 4.
- Dark‑mode toggle and multilingual routing (English and Chinese).
- UI component libraries (Shadcn UI, Radix UI) and animation utilities.
- Search powered by Pagefind and automatic sitemap generation.
Main features
- Docs site and blog starter.
- AI SaaS landing page.
- Dark mode with theme switching.
- i18n support for English and Chinese.
- Shadcn UI and Radix UI components.
- Sass integration and Tailwind CSS 4 utilities.
- Pagefind static search index.
- Post‑build sitemap generation.
Technology stack
- Framework: Next.js 16
- UI: React 19, Tailwind CSS 4, Sass
- Documentation: Nextra 4 (nextra‑theme‑docs)
- Component libraries: Shadcn UI, Radix UI, Aceternity UI
- Language: TypeScript
- Styling helpers: tailwind‑merge, tailwindcss‑animate
- Search: Pagefind
- Other tools: ESLint 9, PostCSS, Iconify, next‑themes, tsparticles
Requirements
- Node >= 20.x
- pnpm >= 9.x
Installation
- Download the starter archive
/download/nextjs-nextra-starter.zip
- Extract the archive to a folder of your choice.
- Open a terminal in the extracted folder.
- Install dependencies
pnpm i
- Run the development server (optional, to verify the setup)
pnpm dev
Open http://localhost:8000 in a browser. The site should load.
- Build the production version
pnpm build
This runs next build. After the build finishes, two post‑build steps are executed automatically:
next-sitemapcreates a sitemap file.pagefindgenerates a static search index inpublic/_pagefind.
- Start the production server (if you want to serve it locally)
pnpm start
The server listens on port 7000 (http://localhost:7000).
Configuration
Configuration files are located at the project root:
next.config.ts– Next.js configuration, including i18n locales, image handling, and Sass options.next-sitemap.config.mjs– Sitemap generation settings.postcss.config.mjs– PostCSS setup for Tailwind.tsconfig.json– TypeScript compiler options.
Environment variables such as SITE_URL can be set to customize the sitemap URL.
Customizing the project
- Tailwind theme: Edit
tailwind.config.js(generated by Tailwind 4) to add colors, spacing, or plugins. - Sass styles: Add or modify
.scssfiles undersrc/assets/and import them where needed. - Content: Place markdown or MDX files in
src/content/enandsrc/content/zhto edit docs or blog posts. - UI components: New Shadcn UI components can be added with
pnpm dlx shadcn@latest add <component>. Existing components live insrc/components/ui/. - Search: The static search index is regenerated automatically after each
pnpm build. Adjust Pagefind options in thepostbuildscript if needed.
Project structure
LICENSE
README.md
package.json
pnpm-lock.yaml
next-env.d.ts
next-sitemap.config.mjs
next.config.ts
postcss.config.mjs
tsconfig.json
public/
img/
favicon.svg
next.svg
vercel.svg
src/
app/
[lang]/
_dictionaries/
assets/
images/
components/
AIDemoLanding/
CustomFooter/
HomepageHero/
MotionWrapper/
PanelParticles/
ScrollProgressBar/
ThemeSwitcher/
TitleBadge/
auth/
ui/
content/
en/
zh/
hooks/
index.ts
useBreakpoint.ts
useLocale.ts
useServerLocale.ts
i18n/
ai-demo.ts
en.ts
index.ts
zh.ts
lib/
utils.ts
mdx-components.ts
proxy.ts
widgets/
auth-button.tsx
locale-toggle.tsx
mobile-menu-auth.tsx
navbar-extras.tsx
theme-toggle.tsx
Tips
- Use
pnpm devduring development; it runs Next.js with Turbopack on port 8000 for fast hot‑reloading. - After editing content, the development server updates automatically; for production, always run
pnpm buildto regenerate the search index. - The project is ready for deployment on Vercel or Netlify; simply point the platform to the repository and it will run
pnpm install && pnpm build && pnpm start. - To add additional locales, update the
i18n.localesarray innext.config.tsand create matching folders undersrc/content/.
License and attribution
The project is licensed under the MIT License. See the full license file at the repository:
https://github.com/pdsuwwz/nextjs-nextra-starter
When redistributing or using this starter, keep the LICENSE file intact and credit the original 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 Nextjs Nextra Starter ## Your task You are a senior frontend engineer. We are building a new project using Nextjs Nextra Starter, 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] # Nextjs Nextra Starter — project brief ## Source project Nextjs Nextra Starter is a starter template that combines Next.js 16, React 19 and Tailwind CSS v4 to create content‑driven sites such as documentation, blogs and AI SaaS landing pages. It includes dark‑mode support, i18n, Shadcn UI, Radix UI and Sass integration. Repository: https://github.com/pdsuwwz/nextjs-nextra-starter – license MIT (see LICENSE, author credited in README). ## Files that matter - **Pages / entry point**: `src/app/[lang]/page.tsx` (dynamic language folder, renders the home page and acts as the entry page for the Next.js app). - **Content**: `src/content/en/` and `src/content/zh/` – markdown/MDX files used by Nextra for docs, blog and landing pages. - **Components**: - `src/components/AIDemoLanding/` – AI SaaS landing page UI. - `src/components/HomepageHero/` – hero section on the home page. - `src/components/ThemeSwitcher/` – dark‑mode toggle. - `src/components/ScrollProgressBar/`, `PanelParticles/`, `MotionWrapper/`, `TitleBadge/`, `CustomFooter/` and UI primitives under `src/components/ui/`. - **Widgets** (small reusable pieces): `src/widgets/auth-button.tsx`, `locale-toggle.tsx`, `mobile-menu-auth.tsx`, `navbar-extras.tsx`, `theme-toggle.tsx`. - **Hooks**: `src/hooks/useBreakpoint.ts`, `useLocale.ts`, `useServerLocale.ts`. - **Utilities**: `src/lib/utils.ts`. - **Assets**: `public/img/` (favicon.svg, next.svg, vercel.svg) and `src/assets/images/` for project images. - **Styles**: Tailwind config is in `tailwind.config.cjs` (implicit via dev dependencies), global CSS files are the three `.css` files in the repo root (exact names not listed in verified data). - **Configuration**: `next.config.ts`, `next-sitemap.config.mjs`, `postcss.config.mjs`, `tsconfig.json`, `next-env.d.ts`. - **MDX components**: `src/mdx-components.ts` – custom components injected into MDX content. ## Setup and build The project requires a build step. Use pnpm as specified in `package.json`. ```bash # Install dependencies pnpm i # Development server (runs on port 8000) pnpm dev # Production build pnpm build # After build, generate sitemap and Pagefind index pnpm postbuild # Start the production server (runs on port 7000) pnpm start ``` The production build outputs to the default `.next` directory; static assets are served from `public/`. ## How it is put together The app uses a **layout component** (implicitly defined in `src/app/layout.tsx`) that wraps every page. Common elements such as the navigation bar, footer, theme switcher and scroll progress bar are rendered in this layout, so they appear on all pages. Content pages are generated by Nextra from the MDX files in `src/content/*`, with custom MDX components supplied by `src/mdx-components.ts`. Key libraries and their initialization: - **next-themes** – provides the dark‑mode context; the `ThemeSwitcher` component toggles the theme. - **radix-ui** components (accordion, hover‑card, separator, toggle) are used inside UI primitives. - **framer‑motion** and **motion** – power animated wrappers like `MotionWrapper`. - **@tsparticles/react** – renders particle effects in `PanelParticles`. - **react-fast-marquee**, **sonner**, **lucide-react** – UI utilities used in various components. - **class-variance-authority**, **tailwind-merge**, **tailwindcss-animate** – help compose Tailwind class strings. Theme values (colors, fonts, spacing) are defined in the Tailwind configuration (v4) and can be extended via Sass files. Dark mode is enabled through `next-themes`; there is no RTL support. Responsive utilities are available via Tailwind, though the repository does not declare a responsive flag. ## Watch out for 1. **Tailwind v4 vs older docs** – class names and configuration syntax differ from Tailwind v3; ensure any custom CSS follows v4 conventions. 2. **Global CSS** – the three root `.css` files are imported globally; they may affect all components, so avoid conflicting class names. 3. **Duplicate library imports** – both `framer-motion` and `motion` are listed; verify which one is actually used to prevent bundle bloat. 4. **Dynamic language folder** – pages live under `src/app/[lang]/`; missing a language parameter can cause 404 during static export. 5. **Pagefind post‑build step** – `pnpm postbuild` must run after `pnpm build`; otherwise search indexing will be missing. 6. **Next.js 16 Turbopack dev server** – the dev script uses `--turbopack`; some plugins may not be fully compatible, leading to runtime warnings. ## Verify - [ ] Home page (`src/app/[lang]/page.tsx`) renders without console errors. - [ ] Dark‑mode toggle changes theme and persists across pages. - [ ] Content from `src/content/en/` and `src/content/zh/` displays correctly via Nextra. - [ ] Particle background (`PanelParticles`) initializes without errors. - [ ] Navigation bar, footer and scroll progress bar appear on every page. - [ ] `pnpm build` completes and `pnpm start` serves the built site on port 7000. - [ ] `pnpm postbuild` generates `public/_pagefind` and sitemap files. - [ ] No duplicate imports of `framer-motion`/`motion` in the final bundle (check bundle analysis if needed). # 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 Nextjs Nextra Starter 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 Nextjs Nextra Starter 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 Nextjs Nextra Starter. ## 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.






