LobeHub's documentation toolkit and lobedocs CLI. Write MDX next to your React components and get a prerendered docs site with live demos, API tables, search, skills.md and llms.txt.
Live Example Β· Changelog Β· Report Bug Β· Request Feature
Table of contents
Docs Kit is the documentation stack behind ui.lobehub.com and the other LobeHub component library sites. It replaces dumi + dumi-theme-lobehub with one installable package: your repo keeps the content and a config file, and the lobedocs CLI does the rest.
- Zero build config: no
vite.config.tsorreact-router.config.tsin your repo; the CLI owns them. - Docs next to code: every
src/**/index.mdxbecomes a component page with live, editable<Demo />blocks. - API tables from TypeScript:
<Api name="Button" />reads props, JSDoc and@defaultfrom your types, and the build fails when a default drifts from runtime. - Static and fast: every page is prerendered, with Pagefind search, a sitemap and Open Graph tags built in.
- Audited builds: broken links, missing demos and wrong API defaults fail
lobedocs buildinstead of reaching readers. - AI-native docs: coding agents read every page through skills.md and llms.txt, generated from the same MDX your users read.
$ pnpm add -D @lobehub/docs-kit @react-router/dev react-router vite tsxDocs Kit needs Node.js >= 22.22, React 19, React Router 8.2+ and Vite 8.1+. Add the scripts to your component library's package.json:
{
"scripts": {
"docs:dev": "lobedocs dev",
"docs:build": "lobedocs build",
"postinstall": "lobedocs typegen"
}
}Then add a docs.config.ts at the repo root and a docs/index.mdx with title and description frontmatter:
// docs.config.ts
export default {
atomDirs: [{ dir: 'src' }],
title: 'Lobe Editor',
description: 'One sentence describing the library.',
siteUrl: 'https://editor.lobehub.com',
alias: { '@lobehub/editor': 'src' }, // demos import the package by name, run from source
themeConfig: {
apiHeader: { packageName: '@lobehub/editor', github: 'https://github.com/lobehub/lobe-editor' },
socialLinks: [
{ href: 'https://github.com/lobehub/lobe-editor', icon: 'github', label: 'GitHub' },
],
},
};Run pnpm docs:dev and open the printed URL. Every config field, including the sidebar, home page, theme, giscus and analytics options, is typed in src/config.ts.
A component page is an index.mdx next to the component. Demo and Api are available in every MDX file without an import:
---
title: Button
description: Button triggers an action. Supports variants, sizes, loading and icon slots.
category: General
---
import Basic from './demos/index.tsx?demo';
<Demo of={Basic} title="Basic usage" />
## API
<Api name="Button" />- Only files named
index.mdxunder anatomDirsroot become pages; the URL comes from the folder (src/chat/ChatItemβ/components/chat/chat-item). - Each demo file has one default export and lives under
src/**/demos/. - Guide pages are
docs/**/*.mdxfiles listed inpublicDocs;themeConfig.sidebarGroupsgives them a sidebar section. - A custom landing page is any module set as
homePage, for example one built from@lobehub/ui/awesome.
| Command | What it does |
|---|---|
lobedocs dev |
Start the dev server with hot reload for MDX, demos and components |
lobedocs build |
Prerender every page, build the search index and agent files, audit the result, write dist/ |
lobedocs typegen |
Generate React Router route types into .react-router/types |
Extra arguments are forwarded to React Router, e.g. lobedocs dev --port 3000. dist/ is plain static HTML that any static host can serve. Restart lobedocs dev after editing docs.config.ts.
Docs Kit's docs are generated for coding agents as well as people. lobedocs dev serves them live, and lobedocs build writes them into dist/:
| Resource | What it does |
|---|---|
| skills.md | Agent skill entry point: site config, folder architecture and a Markdown reference for every page |
| llms.txt | Page index with outlines for llms.txt-aware tools |
| Button skill | Example per-page Markdown reference (/skills/<page>.md), with usage, demos and props |
| Introduction skill | Example guide-page skill for getting started |
Paste this into Cursor, Claude Code, Codex or any other coding agent:
Read https://docs-kit.lobehub.com/skills.md, then use @lobehub/docs-kit to set up a documentation site for my React component library. Follow the installation, docs.config.ts and component-page conventions documented there.
Works with Cursor, Claude Code, Windsurf, GitHub Copilot and other llms.txt-aware tools.
Working on this repository with an agent? Start from AGENTS.md.
You can use Github Codespaces for online development:
Or clone it for local development (Node.js >= 22.22 and pnpm):
$ git clone https://github.com/lobehub/docs-kit.git
$ cd docs-kit
$ pnpm install
$ pnpm devpnpm dev runs lobedocs dev against playground/, a consumer site that documents how to use the kit. pnpm build:playground, pnpm test, pnpm lint and pnpm type-check are what CI runs.
Contributions of all types are more than welcome, if you are interested in contributing code, feel free to check out our GitHub Issues to get stuck in to show us what youβre made of.
Every bit counts and your one-time donation sparkles in our galaxy of support! You're a shooting star, making a swift and bright impact on our journey. Thank you for believing in us β your generosity guides us toward our mission, one brilliant flash at a time.
- π Lobe UI - React component library for AI apps
- π₯¨ Lobe Icons - AI / LLM brand logos and icons
- π Lobe Charts - React chart components
- βοΈ Lobe Editor - Lexical-based rich text editor for React, with Markdown, plugins and a chat composer
- π€ Lobe TTS - TTS / STT speech library
- π Lobe Lint - ESLint, Prettier, Stylelint, Commitlint and more lint configs
- π Fluent Emoji - Fluent Emoji assets
- π Docs Kit - Reusable documentation toolkit and lobedocs CLI for LobeHub component libraries
- π Streamdown - Headless streaming markdown engine for React
