README.md

July 29, 2026 · View on GitHub

PreactPress

PreactPress is the documentation framework for Preact libraries, APIs, and AI coding agents.

npm version Node support CI GitHub stars license

Live demo · Docs starter · Showcase · npm · GitHub

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

Key features

FeatureWhat you get
Preact + MDXVitePress-style docs with Preact components, not Vue
Plugin systemTyped hooks for build, config, MDX, and validation
preactpress checkCI-ready validation for links, routes, nav, redirects, and i18n
Documentation versioningVersion switcher, archived snapshots, scoped search
Redirect systemHTTP redirects with HTML fallbacks and _redirects export
TypeDoc integration@preactpress/plugin-typedoc for API reference pages
Component props reference@preactpress/plugin-component-reference for MDX prop tables
Live Preact playground@preactpress/plugin-playground with sandboxed MDX demos
AI-ready exportsllms.txt, llms-full.txt, per-page Markdown, and api/context.json
Static outputDeploy dist/ to any static host — no runtime server

Quick start

Requirements: Node.js 20+ (tested on 20, 22, and 24).

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

Open http://localhost:5173.

Validate before release:

pnpm check
pnpm build

Live demo

The canonical documentation site is built from templates/docs and published at kamod-ch.github.io/preactpress.

It demonstrates the default theme, local search, Mermaid diagrams, live playgrounds, AI exports, and a small German i18n demo.

Code example

Minimal .preactpress/config.ts:

import { defineConfig } from "@kamod-ch/preactpress/config";
import { playgroundPlugin } from "@preactpress/plugin-playground";

export default defineConfig({
  site: {
    title: "My library",
    description: "API and component documentation",
    url: "https://docs.example.com",
  },
  plugins: [playgroundPlugin()],
  ai: {
    llmsTxt: true,
    llmsFullTxt: true,
    copyMarkdown: true,
    contextIndex: true,
  },
  themeConfig: {
    search: true,
    nav: [{ text: "Guide", link: "/guide/getting-started" }],
    sidebar: [
      {
        text: "Guide",
        items: [{ text: "Getting started", link: "/guide/getting-started" }],
      },
    ],
  },
});

Interactive MDX page:

import Counter from "./components/Counter.tsx";

## Demo

<Counter initial={3} />

Why PreactPress?

Many documentation tools assume Vue or React. PreactPress targets teams who already ship Preact libraries and want a smaller runtime with familiar JSX patterns.

  • Preact-first — tiny bundle, React-like APIs, MDX components are Preact components.
  • VitePress-like DX — file-based Markdown routes, sidebar, outline, search, and dark mode out of the box.
  • Library docs, not just guides — TypeDoc, OpenAPI, component prop tables, and changelog plugins ship as first-class extensions.
  • AI agent ready — static llms.txt / llms-full.txt exports help Cursor, Claude Code, and similar tools index your docs.
  • Static by default — build once, deploy anywhere.

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

Comparison

PreactPressVitePressDocusaurusStarlight
UI stackPreact + MDXVueReactAstro
Docs themeBuilt-inBuilt-inBuilt-inBuilt-in
Runtime sizeSmall Preact bundleVue hydrationReact + routerVaries
TypeScript API docs@preactpress/plugin-typedocManual / pluginsTypeDoc pluginManual
Live code playground@preactpress/plugin-playgroundCustom@docusaurus/theme-live-codeblockCustom
AI exports (llms.txt)Built-inCommunity pluginsCommunity pluginsCommunity plugins
Doc validation CLIpreactpress checkvitepress build onlydocusaurus build onlyAstro build only
Best forPreact libraries, APIs, AI-indexed docsVue documentationLarge React doc portalsMulti-framework content

Choose PreactPress when you document Preact libraries or APIs and want VitePress-style workflows with MDX, plugins, validation, and AI-ready exports.

Choose something else when you need Vue (VitePress), a mature React plugin ecosystem (Docusaurus), or Astro's multi-framework island model (Starlight).

See the full comparison guide on the docs site.

Templates

TemplateUse caseScaffold
defaultMinimal quick startpnpm dlx @kamod-ch/preactpress init my-site
docsFull documentation (canonical reference)pnpm dlx @kamod-ch/preactpress init my-docs --template docs
blogTechnical blog with RSS, tags, authorspnpm dlx @kamod-ch/preactpress init my-blog --template blog
product-docsProduct or library documentationpnpm dlx @kamod-ch/preactpress init my-product --template product-docs
api-docsJavaScript/TypeScript API referencepnpm dlx @kamod-ch/preactpress init my-api --template api-docs
saas-docsSaaS onboarding and admin docspnpm dlx @kamod-ch/preactpress init my-saas --template saas-docs
knowledge-baseHelp center and support articlespnpm dlx @kamod-ch/preactpress init my-help --template knowledge-base
versionsMulti-version documentationpnpm dlx @kamod-ch/preactpress init my-versions --template versions
monorepoDocs inside a pnpm workspacepnpm dlx @kamod-ch/preactpress init my-monorepo --template monorepo
magazineCustom editorial theme (demo)pnpm dlx @kamod-ch/preactpress init my-mag --template magazine
honoProduct landing + docs (demo)pnpm dlx @kamod-ch/preactpress init my-site --template hono

Browse the template gallery or run pnpm run dev:docs from the package root while contributing.

Plugins

Official plugins live under packages/ and are documented on the site:

PluginPurpose
@preactpress/plugin-mermaidMermaid diagrams in Markdown
@preactpress/plugin-playgroundLive Preact sandboxes in MDX
@preactpress/plugin-typedocTypeScript API reference from TypeDoc
@preactpress/plugin-component-referenceComponent prop tables in MDX
@preactpress/plugin-openapiREST API docs from OpenAPI 3.x
@preactpress/plugin-changelogChangelog pages from GitHub Releases or local files

Register plugins in .preactpress/config.ts:

import { defineConfig } from "@kamod-ch/preactpress/config";
import { mermaidPlugin } from "@preactpress/plugin-mermaid";
import { typedocPlugin } from "@preactpress/plugin-typedoc";

export default defineConfig({
  plugins: [mermaidPlugin(), typedocPlugin({ tsconfig: "tsconfig.json", outDir: "api" })],
});

See Plugins and the ecosystem gallery.

Deployment

PreactPress emits static HTML, assets, search index, and optional AI exports. Deploy the dist/ folder to any static host.

preactpress build
# For GitHub Pages project sites:
preactpress build --base /my-repo/

Supported patterns are documented for Netlify, Vercel, Cloudflare Pages, GitHub Actions, and S3-compatible hosts.

Official CI support: kamod-ch/preactpress/action@v2.

Roadmap

Current priorities:

  • Keep templates/docs synchronized with every public option and CLI behavior
  • Expand real-world deployment and plugin examples
  • Performance budgets for generated HTML, CSS, and client JavaScript
  • Additional changelog providers (GitLab, Gitea)

Non-goals for core: production Node server runtime, Vue SFC support, full VitePress theme clone.

See ROADMAP.md and RELEASE-REPORT.md for the full release status.

Contributing

Development scripts:

pnpm install
pnpm run build
pnpm test
pnpm run dev:docs
pnpm run check:docs
pnpm run build:docs
pnpm run verify    # fmt, lint, build, coverage, templates, browser, pack

See CONTRIBUTING.md for package development. Upgrade from a previous release with UPGRADE.md.

License

Built by Klaus Zahiragic | Kamod GmbH

Website · LinkedIn