Skip to main content
doc0blade47/fumadocsdocumentation home
Sign in

Project Structure

Last updated Oct 12, 2026100% grounded
Relevant source files

The following files were used as context for generating this wiki page:

Overview

The Fumadocs monorepo is organized into specialized packages that power documentation generation, processing, and rendering. Workspace packages such as fumadocs-core, fumadocs-ui, @fumadocs/base-ui, fumadocs-mdx, and @fumadocs/openapi collaborate across build and runtime phases to support content transformation, UI layouts, and API spec tooling.

Sources: packages/core/package.json:1-4, packages/radix-ui/package.json:1-4, packages/base-ui/package.json:1-4, packages/mdx/package.json:1-4, packages/openapi/package.json:1-4

Core Architecture and Shared Utilities

Core Package Responsibilities

The foundational runtime and processing logic of the workspace resides in fumadocs-core (packages/core), published under version 16.10.2 as an ES module package. It provides public entrypoints for breadcrumbs, content transformers, dynamic linking, framework adapters, code highlighters, internationalization, page trees, search indexers, and source loaders packages/core/package.json:1-97.

The package exports framework-specific routing and rendering adapters for Next.js, React Router, TanStack, and Waku through its framework entrypoints packages/core/package.json:29-33. Search capabilities span client-side search engines and server integrations for Algolia, Flexsearch, Mixedbread, and Orama Cloud packages/core/package.json:66-80.

Sources: packages/core/package.json:1-97

Shared Utilities and Workspace Workspace Dependencies

Workspace configuration and tooling rely on private shared packages such as shared (packages/shared), which coordinates utility libraries and CLI dependencies across builds packages/shared/package.json:1-15.

Note

The shared package is marked as "private": true and uses ES module imports, depending on fuma-cli and tinyglobby for file globbing and command execution during workspace operations.

Sources: packages/shared/package.json:1-8

User Interface Packages

Radix UI and Base UI Packages

Fumadocs provides two distinct UI implementation packages for its presentation layer: fumadocs-ui (packages/radix-ui), which serves as the Radix UI version of Fumadocs UI under version 16.10.2, and @fumadocs/base-ui (packages/base-ui), which implements the Base UI version under the same version packages/radix-ui/package.json:1-4, packages/base-ui/package.json:1-4. Both packages share identical public export paths for components, layouts, contexts, and providers, but differ in their underlying primitive dependencies.

The Radix UI implementation relies on specific @radix-ui/react-* primitive packages for accessibility and state management, whereas the Base UI variant depends on @base-ui/react for its unstyled component primitives packages/radix-ui/package.json:131-154, packages/base-ui/package.json:127-141.

Sources: packages/radix-ui/package.json:1-4, packages/base-ui/package.json:1-4, packages/radix-ui/package.json:131-154, packages/base-ui/package.json:127-141]

Component Exports and Framework Providers

Both UI packages export extensive sets of component entrypoints, framework providers, and layout slots. The provider entrypoints support multiple frontend architectures, including Next.js, React Router, TanStack, and Waku packages/radix-ui/package.json:104-108, packages/base-ui/package.json:102-106.

Export PathTarget File (dist/)Description
./provider/base./dist/provider/base.jsBase UI/Radix provider implementation
./provider/next./dist/provider/next.jsNext.js framework provider integration
./provider/react-router./dist/provider/react-router.jsReact Router framework provider
./provider/tanstack./dist/provider/tanstack.jsTanStack framework provider
./provider/waku./dist/provider/waku.jsWaku framework provider integration

Sources: packages/radix-ui/package.json:104-108, packages/base-ui/package.json:102-106]

Warning

While fumadocs-ui includes legacy compatibility exports (./legacy/layout and ./legacy/sidebar) alongside standard UI elements, @fumadocs/base-ui omits these legacy paths entirely in favor of its modern layout and slot structure packages/radix-ui/package.json:94-95, packages/base-ui/package.json:18-114.

Sources: packages/radix-ui/package.json:94-95, packages/base-ui/package.json:18-114]

Content Processing and Schema Bundling

Content Collection Schema Configuration

The @fumadocs/content package acts as the content adapter for Fumadocs, integrating with fuma-content and standard schema specifications via @standard-schema/spec packages/content/package.json:2-33. It configures MDX collections and metadata data collections through specialized builder functions such as docsMdxCollection and docsCollection packages/content/src/index.ts:16-53.

Function / ClassParameter / Return TypePurpose
docsMdxCollectionDocsMDXCollectionConfig<FrontmatterSchema>Creates an MDX collection wrapping mdxCollection with preset options and remark include plugins packages/content/src/index.ts:16-33.
docsCollectionDocsCollectionConfig<FrontmatterSchema, MetaSchema>Returns an object containing index, meta, and doc collection handles packages/content/src/index.ts:44-53.
DocsCollectionExtends CollectionSubclass that registers code generators via onEmit.pipe to output store bindings packages/content/src/index.ts:55-70.

Sources: packages/content/src/index.ts:16-70]

Note

The docsMdxCollection utility dynamically evaluates option configurations (whether provided as a static object or an asynchronous factory function) and injects the remarkInclude plugin into the MDX bundler preset packages/content/src/index.ts:24-31.

Sources: packages/content/src/index.ts:24-31]

MDX Transformations and Bundler Integration

The fumadocs-mdx package (packages/mdx/package.json) provides the built-in content source and bundler integrations across multiple target environments and build systems packages/mdx/package.json:2-45. It exposes explicit subpath exports for Node, Next.js, Vite, Bun, Rolldown, and Webpack loaders and plugins packages/mdx/package.json:24-44.

Export SubpathTarget File (dist/)Purpose
../dist/index.jsMain entry point
./bin./dist/bin.jsCLI binary execution entry
./bun./dist/bun/index.jsBun runtime integration
./config./dist/config/index.jsConfiguration loader helpers
./next./dist/next/index.jsNext.js source integration
./node./dist/node/index.jsNode.js source bindings
./node/loader./dist/node/loader.jsNode module loader
./rolldown./dist/rolldown/index.jsRolldown bundler plugin
./vite./dist/vite/index.jsVite bundler plugin
./webpack/mdx./dist/webpack/mdx.jsWebpack MDX loader
./webpack/meta./dist/webpack/meta.jsWebpack meta loader

Sources: packages/mdx/package.json:24-44]

Warning

Bundler plugins and loaders such as rolldown, vite, and webpack are declared as optional peer dependencies alongside next and mdast-util-directive, allowing consumer projects to install only the toolchain integrations they require packages/mdx/package.json:96-132.

Sources: packages/mdx/package.json:96-132]

API Specification Tooling

OpenAPI and AsyncAPI Processing Packages

The API specification ecosystem in Fumadocs is powered by three specialized packages: @fumadocs/api-docs (packages/api-docs/package.json), fumadocs-openapi (packages/openapi/package.json), and @fumadocs/asyncapi (packages/asyncapi/package.json) packages/api-docs/package.json:2-45, packages/openapi/package.json:2-37, packages/asyncapi/package.json:2-25. These packages supply shared utility modules, server bindings, request code generators, and UI presentation components for machine-readable API specifications.

Package NameVersionDescriptionKey Subpath Exports
@fumadocs/api-docs0.0.2Shared utils for API docs generation./schema, ./schema/bundle, ./schema/dereference, ./components/schema packages/api-docs/package.json:2-38
fumadocs-openapi11.0.2Generate MDX docs for your OpenAPI spec., ./i18n, ./scalar, ./server, ./ui, ./requests/generators/all packages/openapi/package.json:2-36
@fumadocs/asyncapi0.0.2Generate docs for your AsyncAPI spec., ./i18n, ./server, ./ui packages/asyncapi/package.json:2-24

Sources: packages/api-docs/package.json:2-38, packages/openapi/package.json:2-36, packages/asyncapi/package.json:2-24]

Note

@fumadocs/api-docs bundles and inlines critical JSON Schema processing tools such as @apidevtools/json-schema-ref-parser, @fastify/deepmerge, and ajv directly within its distribution configuration packages/api-docs/package.json:97-104.

Sources: packages/api-docs/package.json:97-104]

Request Generators and Code Generation Modules

The fumadocs-openapi package exposes modular request code generators under its ./requests/generators/* export paths, enabling automatic generation of client request snippets across multiple target languages packages/openapi/package.json:22-29.

Export SubpathTarget File (dist/)Purpose
./requests/generators./dist/requests/generators/index.jsMain generators dispatcher entry point packages/openapi/package.json:22
./requests/generators/all./dist/requests/generators/all.jsBundle aggregator for all supported languages packages/openapi/package.json:23
./requests/generators/csharp./dist/requests/generators/csharp.jsC# HTTP request snippet generator packages/openapi/package.json:24
./requests/generators/curl./dist/requests/generators/curl.jscURL command-line snippet generator packages/openapi/package.json:25
./requests/generators/go./dist/requests/generators/go.jsGo net/http request generator packages/openapi/package.json:26
./requests/generators/java./dist/requests/generators/java.jsJava HTTP request generator packages/openapi/package.json:27
./requests/generators/javascript./dist/requests/generators/javascript.jsJavaScript fetch snippet generator packages/openapi/package.json:28
./requests/generators/python./dist/requests/generators/python.jsPython requests snippet generator packages/openapi/package.json:29

Sources: packages/openapi/package.json:22-29]

Warning

Optional peer dependencies such as @scalar/api-client-react and json-schema-typed must be explicitly installed by consuming applications when utilizing interactive Scalar API playground components or strict schema typing packages/openapi/package.json:79-98.

Sources: packages/openapi/package.json:79-98]

Language Analysis and Code Generation

TypeScript and Twoslash Integrations

The workspace provides dedicated tooling for TypeScript code analysis, interactive type annotations, and documentation generation through fumadocs-typescript, fumadocs-twoslash, and fumadocs-docgen. These packages integrate syntax analysis, tree transformations, and build-time code transformations.

Package NameMain Entry Point (dist/)Primary Export SubpathsDescription
fumadocs-twoslash./dist/index.js packages/twoslash/package.json:18-18./twoslash.css, /., ./ui, ./cache-fs packages/twoslash/package.json:21-33TypeScript Twoslash integration with Shiki and UI popover support packages/twoslash/package.json:2-4, packages/twoslash/package.json:46-52
fumadocs-typescript./dist/index.js packages/typescript/package.json:17-17., ./ui packages/typescript/package.json:20-27TypeScript code intelligence and AST utilities via ts-morph packages/typescript/package.json:2-4, packages/typescript/package.json:46-46
fumadocs-docgen./dist/index.js packages/doc-gen/package.json:19-19., ./remark-ts2js packages/doc-gen/package.json:22-29Remark plugins and utilities including TypeScript-to-JavaScript code transformation packages/doc-gen/package.json:2-4, packages/doc-gen/package.json:26-29
@fumadocs/languageNot applicable (exports individual translation files) packages/language/package.json:17-21./zh-cn, ./zh-tw, ./package.json packages/language/package.json:18-20Common localized language packs and integration metadata for Fumadocs packages packages/language/package.json:2-4, packages/language/package.json:17-21

Sources: packages/twoslash/package.json:2-34, packages/typescript/package.json:2-28, packages/doc-gen/package.json:2-30, packages/language/package.json:2-21]

Warning

@fumadocs/language declares peer dependencies on several workspace API and story components (@fumadocs/api-docs, @fumadocs/asyncapi, @fumadocs/story, fumadocs-core, fumadocs-openapi, fumadocs-ui) marked as optional, meaning consuming projects must provide the specific packages corresponding to the desired localized documentation tools packages/language/package.json:43-70.

Sources: packages/language/package.json:43-70]

Transformation Dependencies and Syntax Processing

Code analysis modules rely on syntax transformers and AST parsers to manipulate Markdown and code structures. fumadocs-typescript integrates ts-morph alongside estree-util-value-to-estree, hast-util-to-estree, and hast-util-to-jsx-runtime packages/typescript/package.json:39-49. Similarly, fumadocs-docgen leverages oxc-transform and zod schema parsing to process and convert code snippets packages/doc-gen/package.json:41-50.

Tip

When configuring fumadocs-twoslash, consumers can import cache layers via the ./cache-fs export path alongside @shikijs/twoslash and twoslash dependencies to persist type check results across builds packages/twoslash/package.json:30-33, packages/twoslash/package.json:47-47, packages/twoslash/package.json:52-52.

Sources: packages/twoslash/package.json:30-33, packages/twoslash/package.json:47-47, packages/twoslash/package.json:52-52, packages/typescript/package.json:39-49, packages/doc-gen/package.json:41-50]

Python Tooling and Components

Fumapy Core Package Configuration

The fumapy Python library (fumadocs-python) extracts API documentation from source code and docstrings, serving as the back-end extraction engine for Fumadocs packages/python/package.json:2-4, packages/python/pyproject.toml:2-4. Managed via Hatchling as its build-backend, it requires Python 3.10 or newer and depends on griffe and griffe_typingdoc to inspect Python code structures packages/python/pyproject.toml:7-8, packages/python/pyproject.toml:13-15. The command-line script entrypoint fumapy-generate points directly to the generate function inside the package packages/python/pyproject.toml:10-11.

Sources: packages/python/package.json:2-4, packages/python/pyproject.toml:2-15]

Note

fumapy relies strictly on griffe (versions >=1.13.0, <2.0.0) and griffe_typingdoc (versions >=0.2.8, <1.0.0) for static analysis and docstring typing support packages/python/pyproject.toml:8-8.

Sources: packages/python/pyproject.toml:8-8]

Module and Type Models

The fumapy.mksource subpackage exports core parsing helpers and typed model structures that define how Python symbols are represented packages/python/fumapy/mksource/init.py:1-9. The models utilize TypedDict definitions to represent modules, classes, functions, parameters, attributes, and docstring sections packages/python/fumapy/mksource/models.py:6-60.

ModelKey FieldsDescription
Modulename, path, filepath, description, docstring, attributes, modules, classes, functions, versionRepresents a parsed Python module container holding nested modules, classes, and functions.
Classname, path, description, parameters, attributes, docstring, functions, sourceRepresents a Python class declaration including its source string and member functions.
Functionname, path, signature, description, parameters, returns, docstring, sourceRepresents a function or method signature, return annotations, and source code.
Parametername, annotation, description, valueDescribes an individual function parameter or class argument with type annotations and defaults.
Attributename, annotation, description, valueCaptures class or module-level attributes and field assignments.
DocstringSectionkind, valueRepresents structural sections parsed out of docstrings.

Sources: packages/python/fumapy/mksource/init.py:1-9, packages/python/fumapy/mksource/models.py:6-60]

React Presentation Components

The front-end package fumadocs-python exposes UI presentation components under its ./components export path to render Python API documentation packages/python/package.json:28-31, packages/python/src/components/index.tsx:25-133. These components use Tailwind CSS, class-variance-authority, and Fumadocs UI primitives to display code symbols, badges, parameters, and collapsible source blocks.

ComponentPropsPurpose
PyFunctionname, type, childrenRenders a function symbol card with a specialized func badge and type signature packages/python/src/components/index.tsx:25-40.
PyAttributename, type, value, childrenDisplays an attribute card featuring an attribute badge, type, and default value packages/python/src/components/index.tsx:42-69.
PyParametername, type, value, childrenFormats function parameters inside a secondary container with a param badge packages/python/src/components/index.tsx:71-101.
PySourceCodechildrenWraps raw source code blocks in a collapsible element with a toggle trigger packages/python/src/components/index.tsx:103-121.
PyFunctionReturntype, childrenPresents function return types and descriptions within a structured box packages/python/src/components/index.tsx:123-133.

Sources: packages/python/package.json:28-31, packages/python/src/components/index.tsx:25-133]

Scaffolding and Authoring Integrations

Project Scaffolding and Preview CLI

The package create-fumadocs-app initializes and scaffolds new documentation sites, relying on dependency version tracking managed by create-fumadocs-versions packages/create-app/package.json:2-6, packages/create-app-versions/package.json:2-5. Concurrently, fumadocs-preview provides an opinionated framework for fast content previews using Waku and Hono packages/preview/package.json:2-4, packages/preview/package.json:29-32, [packages/preview/package.json:43-65](https://github.com/blade47/fumadocs/blob/a9f988897e7dc4ef3d62b2865d80da2f560770

Was this page helpful?