Fumadocs Core

The headless React library for building documentation websites, with source loading, page trees, MDX processing, search, and i18n.

Library
npm
v16.15.15
13,237 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
90 /100 Excellent
Development Activity 100
Maintenance 100
Community 68
Maturity 52
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
87 /100 Excellent
Architecture 90
Code Quality 82
Innovation 88
Learning Curve 80

Fumadocs Core is the headless engine behind Fumadocs, the React.js documentation framework. It provides the framework-agnostic building blocks a docs site needs — a content source loader that turns files into structured page trees, a full remark/rehype MDX plugin suite, multi-provider full-text search, Shiki-powered syntax highlighting, internationalization, and adapters for Next.js, Astro, React Router, TanStack Start, and Waku.

Because it ships as headless logic rather than prebuilt UI, you compose it directly in your own components and routes, giving you complete control over rendering while still getting the hard parts — content resolution, tree building, TOC generation, and search indexing — handled for you.

What You Get

  • A content source loader (loader()) that converts files and virtual sources into a navigable, typed page tree
  • A complete remark/rehype MDX plugin suite for headings, TOC, code blocks, admonitions, package-manager tabs, structure extraction, and more
  • Multi-provider full-text search — FlexSearch, Orama, Algolia, and Mixedbread — with server and client helpers
  • Shiki-based syntax highlighting utilities for server and client rendering
  • Framework adapters for Next.js, Astro, React Router, TanStack Start, and Waku plus i18n middleware and locale negotiation

Common Use Cases

  • Building a custom-designed documentation site where you own all the UI but want content loading and search handled
  • Adding fast, static or hosted full-text search to an existing docs or content site
  • Processing MDX content with a curated set of remark/rehype plugins for headings, code, and callouts
  • Serving localized documentation with locale negotiation and i18n-aware routing

Under The Hood

Architecture

Fumadocs Core is organized as a headless pipeline. The loader() in src/source/loader.ts composes a ContentStorage builder with a page-tree builder (src/source/page-tree/builder.ts), applying a plugin chain (slugs, icons) to resolve file-based or virtual sources into a typed, serializable page tree; storage is abstracted behind a FileSystem layer so content origins are pluggable. MDX handling lives under src/mdx-plugins as discrete remark/rehype transforms, search under src/search splits into server and client halves per provider, and src/framework supplies per-framework adapters (Next, Astro, React Router, TanStack, Waku) over a shared framework abstraction.

Tech Stack

Written in TypeScript and shipped ESM-only, it builds on the unified/remark/rehype ecosystem (remark, remark-gfm, remark-rehype, mdast/hast utilities), Shiki for highlighting, Orama for in-repo search, and github-slugger, tinyglobby, and yaml for content plumbing. React 19, Next 16, and the various search providers (Algolia, Mixedbread, FlexSearch, Orama Cloud) are peer dependencies, keeping the core lean. Builds run through tsdown and tests through Vitest.

Code Quality

The codebase is strongly typed with generics threaded through the loader and storage types, and uses path aliases and clear module boundaries. A Vitest suite (packages/core/test) covers loader, search, MDX plugins, frontmatter, highlight, and negotiation behavior — solid for the critical paths, though modest in count relative to the package’s large public surface.

API Design

The public API is deliberately composable: a single loader() call yields typed page/meta accessors, search and highlight helpers are small focused functions, and framework adapters are exposed as separate subpath exports so consumers import only what they use. The tradeoff for that breadth is a wide surface with many entry points, which raises the initial orientation cost — mitigated by extensive external documentation at fumadocs.dev and a large examples directory.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers