README.md

June 24, 2026 · View on GitHub

PreactPress

The documentation framework for Preact projects.

npm version CI GitHub stars license

Live demo · Docs starter · npm · GitHub · Issues

If PreactPress saves you time, star the repo — it helps others discover the project.

PreactPress in 30 seconds

PreactPress is a documentation framework for teams who want VitePress-style docs, but built with Preact + MDX instead of Vue.

It is for you if you want to:

  • ship product docs, guides, knowledge bases, or marketing-adjacent content
  • author mostly in Markdown/MDX, but still embed interactive Preact components
  • deploy static output to any host without a complex runtime
  • keep the stack small and close to the Preact ecosystem

It is probably not for you if you want:

  • Vue-first docs tooling → use VitePress
  • React-first docs tooling and a bigger plugin ecosystem → use Docusaurus
  • a broader content/site framework with islands and many rendering models → use Astro

Why not VitePress, Docusaurus, or Astro?

ToolChoose it whenWhy choose PreactPress instead
VitePressYou are happy with Vue and want the reference docs DX in that ecosystemYou want the same docs workflow, but with Preact components and MDX
DocusaurusYou want React, versioning-heavy docs, and its mature plugin ecosystemYou want a smaller runtime and a more lightweight Preact-first stack
AstroYou are building a broader content site and want islands across frameworksYou want a focused docs framework with a built-in docs theme, not a general site framework

Start in 30 seconds

Requirements: Node 20+.

pnpm dlx @kamod-ch/preactpress init my-docs
cd my-docs
pnpm install
pnpm dev

Open http://localhost:5173.

Want the full reference starter instead?

pnpm dlx @kamod-ch/preactpress init my-docs --template docs
cd my-docs && pnpm install && pnpm dev

What does the result look like?

You get a production-ready docs site with:

  • responsive navigation, sidebar, outline, and dark mode
  • Markdown/MDX pages with Preact components
  • built-in search, SEO defaults, sitemap, feeds, and static output
  • a default docs theme you can use immediately or replace later

Docs theme built with PreactPress

Why PreactPress?

Many static site generators are tied to React, Vue, or a heavy runtime. PreactPress targets a smaller stack:

  • Preact-first — tiny runtime and familiar patterns if you already use React-like APIs.
  • VitePress-like DX — file-based Markdown routes, docs theme, sidebar, outline, and search out of the box.
  • MDX + Preact — interactive content and custom themes are Preact components, not Vue SFCs.
  • Static by default — build once, deploy dist/ to any static host.

Pair with Kamod UI for Preact + Tailwind components inside MDX pages.

When to use PreactPress

PreactPressVitePressAstro
UI stackPreact + MDXVueFramework-agnostic islands
Docs themeBuilt-in defaultBuilt-in defaultAdd-on / DIY
RuntimeSmall Preact bundleVue hydrationVaries by integration
Best forPreact teams, VitePress-like docs, MDX interactivityVue documentation sitesMulti-framework content sites

Choose PreactPress when you want VitePress-style documentation workflows with Preact and MDX, static output, and a theme you can replace with your own Preact layout.

Choose something else when you need Vue (VitePress), React-only ecosystems, or Astro's multi-framework island model.

Starter templates

TemplateUse caseScaffold
defaultMinimal docs site with home hero and guide pagespnpm dlx @kamod-ch/preactpress init
docsFull documentation starter (canonical reference)pnpm dlx @kamod-ch/preactpress init my-docs --template docs
magazineCustom theme with article teasers and tag pagespnpm dlx @kamod-ch/preactpress init my-mag --template magazine
honoPolished product/docs layout with custom Preact themepnpm dlx @kamod-ch/preactpress init my-site --template hono

Browse the live demo for the docs template, or run pnpm run dev:docs from the package root while contributing.

PreactPress docs theme on mobile

Examples

The package focuses on the PreactPress CLI, theme, and init templates. Extra example work lives under examples/, including the ready-to-edit Remotion YouTube starter.

Features

Authoring

  • file-based .md and .mdx routing
  • frontmatter for titles, descriptions, tags, drafts, and layout chrome
  • Preact components in MDX
  • syntax highlighting, containers, alerts, code groups, includes, snippets, emoji, and optional math

Theme and navigation

  • default theme with responsive nav, sidebar, outline, search, dark mode, tags, and i18n
  • home, page, and doc layouts with hero and feature grids
  • local search or Algolia DocSearch
  • custom themes via Preact layout components

SEO and deploy

  • sitemap, robots, feeds, canonical URLs, Open Graph, and JSON-LD
  • static HTML for every route; lazy-loaded Markdown payloads after hydration
  • deploy to Netlify, Vercel, Cloudflare Pages, GitHub Pages, S3, or any static host

Developer experience

  • development SSR and static production output
  • route rewrites, dynamic routes, content loaders, build hooks, and MPA mode
  • preactpress check for routes, links, navigation, locales, and drafts

Commands

CommandPurpose
preactpress init [dir]Scaffold a site
preactpress dev [root]Start development
preactpress check [root]Validate before release
preactpress build [root]Generate static output
preactpress preview [root]Preview the generated site

Pass --base /my-repo/ when building for a GitHub Pages project site.

Minimal configuration

export default {
  site: {
    title: "My docs",
    description: "Product documentation",
    url: "https://example.com",
  },
  themeConfig: {
    search: true,
    nav: [{ text: "Guide", link: "/guide/getting-started" }],
    sidebar: [
      {
        text: "Guide",
        items: [{ text: "Getting started", link: "/guide/getting-started" }],
      },
    ],
  },
};

Every Markdown or MDX file below srcDir becomes a route unless it matches srcExclude.

Documentation

The canonical, runnable documentation lives in templates/docs. It covers authoring, routing, i18n, the default theme, all configuration options, CLI validation, deployment, hooks, data loaders, dynamic routes, and custom themes.

Use these package scripts while contributing:

pnpm run build
pnpm test
pnpm run dev:docs
pnpm run check:docs
pnpm run build:docs

See CONTRIBUTING.md for package development and ROADMAP.md for current priorities.

License

MIT.