DocsKit
Quick Start
Requirements: Node.js 18+ and pnpm. DocsKit also uses Pagefind for search - it is built automatically after pnpm build. No external services or environment variables required to get started.
Download and unzip
Install dependencies
pnpm installNo pnpm? Install it first:
npm install -g pnpmStart the dev server
pnpm devOpen
http://localhost:3002 to see the site. The marketing homepage is at / and all docs pages are at /docs.Note: search does not work in development - it requires the Pagefind index which is only generated during pnpm build.
Build for production
pnpm buildThe build runs Next.js static export first, then automatically indexes your content with Pagefind. To preview locally:
pnpm start # or: cd out && python3 -m http.server 3002
Folder Structure
Content lives in content/docs/ as MDX files. The navigation is configured separately in src/config/nav.ts. Adding a new page is a two-step process: create the MDX file, then add it to the nav config.
content/
├── docs/
│ ├── getting-started/
│ │ ├── introduction.mdx
│ │ ├── installation.mdx
│ │ ├── quick-start.mdx
│ │ └── customizing.mdx
│ ├── configuration/
│ │ └── options.mdx
│ ├── components/
│ │ ├── callout.mdx
│ │ └── code-block.mdx
│ └── api-reference/
│ ├── steps.mdx
│ └── tabs.mdx
src/
├── app/
│ ├── globals.css # CSS variables + Tailwind base styles
│ ├── layout.tsx # Root layout — Inter via next/font
│ ├── page.tsx # Marketing homepage
│ └── docs/
│ ├── layout.tsx # Docs shell: sidebar + TOC wrapper
│ └── [[...slug]]/
│ └── page.tsx # Dynamic route for all doc pages
├── components/
│ ├── docs/
│ │ ├── mdx/ # Callout, CodeBlock, Steps, Tabs components
│ │ │ └── index.tsx # MDX component map (h1-h3, p, code, table…)
│ │ ├── Sidebar.tsx # Left navigation sidebar
│ │ ├── TableOfContents.tsx # Right-side heading TOC
│ │ ├── DocsPager.tsx # Previous / next page navigation
│ │ ├── SearchBar.tsx # Pagefind search input
│ │ └── MobileSidebarDrawer.tsx # Mobile slide-out nav
│ ├── marketing/ # Marketing homepage sections
│ │ ├── Hero.tsx, Features.tsx, Comparison.tsx
│ │ ├── Testimonials.tsx, HowItWorks.tsx, Pricing.tsx
│ │ ├── FAQ.tsx, CallToAction.tsx, Preview.tsx
│ │ ├── TechStack.tsx, MarketingFooter.tsx
│ ├── Logo.tsx # Brand logo mark
│ └── ThemeToggle.tsx # Dark/light mode toggle
├── config/
│ └── nav.ts # Sidebar navigation (typed NavGroup[])
└── lib/
├── get-content.ts # Read MDX files from disk
├── get-headings.ts # Extract h2/h3 headings for TOC
├── walk-content.ts # List all content files for static params
└── get-pager.ts # Previous / next page logicThe [[...slug]] catch-all route handles every URL under /docs/. It maps the URL slug to a file path in content/docs/ and compiles the MDX at request time.
Customization
Adding a new doc page
Two steps: create the MDX file and add a nav entry.
1. Create content/docs/your-section/your-page.mdx — no frontmatter needed, the title is read from the first # heading:
# Your Page Title Content goes here. You can use **Callout**, **Steps**, **Tabs**, and **CodeBlock** components.
2. Add it to src/config/nav.ts:
export const nav: NavGroup[] = [
{
title: "Your Section",
items: [
{ title: "Your Page", href: "/docs/your-section/your-page" },
],
},
];Colors and theme tokens
All colors are CSS custom properties in src/app/globals.css. The template ships with a purple primary on a near-black dark background. To change the accent color, update --primary in both the :root (dark, default) and [data-theme="light"] blocks:
:root {
/* dark mode (default) */
--background: #07070f;
--foreground: #f3f4f6;
--primary: #8b5cf6; /* violet-500 — change to your brand */
--primary-hover: #7c3aed;
--muted: #1a1a2e;
--muted-foreground: #9ca3af;
--border: #1f1f3a;
--card: #0f0f1a;
}
[data-theme="light"] {
--background: #ffffff;
--foreground: #09090b;
--muted: #f4f4f5;
--muted-foreground: #71717a;
--border: #e4e4e7;
--primary: #7c3aed; /* slightly deeper for light mode */
--primary-hover: #6d28d9;
--card: #fafafa;
}MDX components
DocsKit ships four custom MDX components you can use in any .mdx file without importing them:
<Callout variant="note|warning|tip|danger">- colored left-border alert boxes<Steps><Step title="...">...</Step></Steps>- numbered step sequence<Tabs><Tab label="...">...</Tab></Tabs>- tabbed content switcher<CodeBlock filename="file.sh">- syntax-highlighted code with filename tab and copy button
All standard HTML elements (h1-h3, p, ul, table, blockquote, code) are also styled via the component map in src/components/docs/mdx/index.tsx.
Brand and marketing homepage
The marketing homepage at src/app/page.tsx is separate from the docs shell. Edit the hero copy, feature list, and CTA text directly in that file. The site name and metadata are set in src/app/layout.tsx.
Syntax highlighting theme
Code blocks are highlighted by rehype-pretty-code using Shiki. The default theme is one-dark-pro and it is set in src/app/docs/[[...slug]]/page.tsx under the rehypePrettyCode options. Shiki ships with 100+ themes - swap the theme value to any name from the Shiki theme list.
Deployment
Static export
DocsKit is pre-configured as a static site (output: "export" in next.config.ts). The build produces a standalone out/ folder that works on any static host - no Node.js server required at runtime.
Environment variables
One optional variable controls canonical URL generation:
NEXT_PUBLIC_SITE_URL=https://docs.yourproduct.com
Set this in production so the <link rel="canonical"> tags in your page HTML point to the right domain. It is safe to leave it unset locally.
Deploy to Vercel (recommended)
Push to GitHub, then import at vercel.com/new. Vercel detects Next.js automatically. Set NEXT_PUBLIC_SITE_URL in Project Settings > Environment Variables before your first production deploy.
Deploy to Netlify
Connect your repo in the Netlify dashboard. Set build command to pnpm build and publish directory to out. Add NEXT_PUBLIC_SITE_URL in Site Settings > Environment Variables.
Deploy to Cloudflare Pages / GitHub Pages
Set build command to pnpm build and output directory to out. Because DocsKit uses trailingSlash: true, each page is emitted as page-name/index.html - compatible with virtually every static host without extra rewrite rules.
Still stuck?
Email us at support@thekitbase.app with your order number and we'll help you get set up.