Switch to Fumadocs
How to change the documentation provider to Fumadocs.
Fumadocs is a beautiful & powerful docs framework powered by Next.js, allowing advanced customisations.
1. Create a Fumadocs App
Fumadocs is similar to a set of libraries built on Next.js App Router, which works very differently from a hosted solution like Mintlify, or other frameworks/static site generator that takes complete control over your app.
To begin, you can use a command to initialize a Fumadocs app quicky:
Here we assume you have enabled Fumadocs MDX, Tailwind CSS, and without a default ESLint config.
What is a Content Source?
The input/source of your content, it can be a CMS, or local data layers like Content Collections and Fumadocs MDX (the official content source).
Fumadocs is designed carefully to allow a custom content source, there’s also examples for Sanity if you are interested.
lib/source.ts
is where you organize code for content sources.Update your Tailwind CSS
Start the app with pnpm dev
.
If some styles are missing, it could be due to your monorepo setup, you can change the content
property in your Tailwind CSS config (tailwind.config.mjs
) to ensure it works:
You can either keep the Tailwind config file isolated to the docs, or merge it with your existing config from the tailwind-config
package.
2. Migrate MDX Files
Fumadocs, same as Mintlify, utilize MDX for content files. You can move the .mdx
files from your Mintlify app to content/docs
directory.
title
frontmatter property.The MDX syntax of Fumadocs is almost identical to Mintlify, despite from having different components and usage for code blocks. Visit Markdown for supported Markdown syntax.
Code Block
Code block titles are formatted with title="Title"
.
Code highlighting is done with an inline comment.
In Fumadocs, you can also highlight specific words.
Code Groups
For code groups, you can use the Tabs
component:
Fumadocs also has a built-in integration for TypeScript Twoslash, check it out in the Setup Guide.
Callout
Fumadocs uses a generic Callout
component for callouts, as opposed to Mintlify’s specific ones.
Adding Components
To use components without import, add them to your MDX component.
3. Migrate mint.json
File
Instead of a single file, you can configure Fumadocs using code.
Sidebar Items
The sidebar items are generated from your file system, Fumadocs takes meta.json
as the configurations of a folder.
You don’t need to hardcode the sidebar config manually.
For example, to customise the order of pages in content/docs/components
folder, you can create a meta.json
folder in the directory:
Fumadocs also support the rest operator (...
) if you want to include the other pages.
Visit the Pages Organization Guide for an overview of supported syntaxs.
Appearance
The overall theme can be customised using CSS variables and/or presets.
CSS variables
In your global CSS file:
Tailwind Presets
In your Tailwind config, use the preset
option.
Layout Styles
You can open app/layout.config.tsx
, it contains the shared options for layouts.
Fumadocs offer a default Docs Layout for documentation pages, and Home Layout for other pages.
You can customise the layouts in layout.tsx
.
Search
app/api/search/route.ts
contains the Route Handler for search, it is powered by Orama by default.
Navigation Links
Navigation links are passed to layouts, you can also customise them in your Layout config.
See all supported items.
Done
Now, you should be able to build and preview the docs.
Visit Fumadocs for details and additional features.