A secondary development framework for building your own business component library on top of
antdv-next.
docs-base is a starter repository for teams that want more than a plain component package. It combines component-library packaging, a live documentation site, and a Markdown demo pipeline in one codebase, so you can develop components and publish docs from the same project.
Replace the template package name with your own package name first.
This repository uses @org/components as the default placeholder package name. Before secondary development, perform a global search and replace for @org/components and change it to your real package name.
This project is intentionally theme-neutral.
It does not lock you into a built-in business theme. You are expected to define your own brand style, design tokens, color system, component appearance, and other theme effects according to your product requirements.
Use this repository when you want to:
- build a business-oriented component library based on
antdv-next - keep source code, demos, and documentation in one place
- ship typed Vue 3 components with ESM and UMD outputs
- write docs in Markdown while rendering real Vue demos inline
- maintain Chinese and English documentation pages in the same structure
- build your own theme system instead of inheriting a fixed visual style
- Vue 3 + TypeScript + Vite
antdv-nextas the UI foundation- library builds for module output, bundled ESM, and UMD
- generated type declarations for components
- custom Markdown-to-Vue pipeline for the docs app
- live demo blocks with source extraction and hot updates
- UnoCSS, Vue Router, Pinia, and Vue I18n integration
- no built-in business theme, making custom theming easier
- sample components and docs pages you can extend directly
- Node.js
^20.19.0 || >=22.12.0 pnpm@10
pnpm installpnpm docs:devThe local docs site runs on http://localhost:6878.
pnpm buildpnpm docs:build
pnpm docs:preview
pnpm type-check
pnpm test:unit.
├─ components/ # Your business components
│ ├─ button/
│ └─ form/
├─ docs/ # Documentation app
│ ├─ src/pages/ # Markdown pages and Vue home page
│ ├─ src/components/demo/ # Demo renderer and source viewer
│ └─ plugins/markdown/ # Markdown and demo transformation pipeline
├─ vite.build.config.ts # Preserve-module component build
├─ vite.esm.config.ts # Bundled ESM build
├─ vite.umd.config.ts # UMD build
└─ global.d.ts # Global component typings
Create your components under components/. Export them from components/index.ts, and keep package-level exports aligned with the API you want to publish.
Add Markdown pages under docs/src/pages/. This project auto-registers .md pages as routes through import.meta.glob.
Recommended locale naming:
*.zh-CN.md*.en-US.md
The current router uses zh-CN as the default locale and appends a suffix for non-default locale routes.
Place demo files in a sibling demo/ directory, then reference them with:
<demo-group>
<demo src="./demo/basic.vue">Basic example</demo>
</demo-group>The docs pipeline will:
- render the live Vue demo
- extract component source
- generate highlighted code blocks
- hot-update demo metadata during development
Running pnpm build produces three kinds of outputs:
- preserved module files in
dist/ - bundled ESM entry as
dist/index.esm.js - bundled UMD entry as
dist/index.umd.js
This makes the template suitable both for modular consumption and for traditional bundled distribution.
- The docs app treats Markdown files as Vue components.
- Demo parsing supports custom
<docs>blocks inside demo SFCs. - Component usage inside the docs app is wired through the local package entry, so the docs site always reflects the current workspace code.
- Theme style is not predefined at the framework level, so visual tokens and presentation should be implemented by your team.
- Perform a global replacement of
@org/componentsand change it to your own package name. - Replace the sample components in
components/with your own business components. - Rename the package in
package.json. - Update the docs home page and Markdown pages in
docs/src/pages/. - Adjust build, external dependencies, and global typings as your library evolves.
Chinese documentation is available in README.zh-CN.md.