Co-authored by
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:Terminal
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 withpnpm 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:
tailwind.config.mjs
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.
Fumadocs requires a
title frontmatter property.Code Block
Code block titles are formatted withtitle="Title".
Fumadocs
Code Groups
For code groups, you can use theTabs component:
Callout
Fumadocs uses a genericCallout component for callouts, as opposed to Mintlify’s specific ones.
Adding Components
To use components without import, add them to your MDX component.app/docs/[[...slug]]/page.tsx
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 takesmeta.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:
meta.json
...) if you want to include the other pages.
meta.json
Appearance
The overall theme can be customised using CSS variables and/or presets.CSS variables
In your global CSS file:global.css
Tailwind Presets
In your Tailwind config, use thepreset option.
tailwind.config.mjs
Layout Styles
You can openapp/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.app/layout.config.tsx