Getting Started
LitMDX turns a folder of .mdx files into a fast, search-enabled documentation site. No framework knowledge required.
Requirements
- Node.js 18+ or Bun 1.0+
- A package manager:
bun,npm,pnpm, oryarn
Installation
Use the official scaffolder to create a new LitMDX project:
npx create-litmdxThe scaffolder will prompt you for a project name and directory, then set up everything you need.
Start the dev server
npm run devOpen http://localhost:5173. LitMDX serves all .mdx files as routes:
| File | Route |
|---|---|
docs/index.mdx | / |
docs/guide.mdx | /guide |
docs/guide/install.mdx | /guide/install |
docs/guide/index.mdx | /guide |
Tip
The dev server supports Hot Module Replacement. Edits to .mdx files appear instantly without a full reload.
Build for production
npm run buildThis runs three steps:
- Vite build — bundles assets into
dist/assets/ - Static Site Generation — prerenders each known route to
dist/**/index.html - Pagefind index — generates
dist/pagefind/for full-text search
Deploy the dist/ folder to any static host (Netlify, Vercel, GitHub Pages, Cloudflare Pages, S3, etc.).
Optional: configuration file
LitMDX works with zero configuration. When you need to customize the site, create litmdx.config.ts at your project root:
// litmdx.config.ts
import { defineConfig } from '@litmdx/core';
export default defineConfig({
title: 'My Project',
description: 'Official documentation for My Project',
github: 'https://github.com/you/my-project',
});See the Configuration guide for all available options.

