Skip to Content
docscn

Migrating from Fumadocs UI

Replace fumadocs-ui in an existing Fumadocs app with docscn, mostly by changing import paths.

docscn keeps Fumadocs UI's component names, props and module paths, so a project made with create-fumadocs-app (Next.js and Fumadocs MDX) migrates in a few steps. docscn's CI runs exactly these steps on the stock template on every change.

Steps

1. Set up shadcn/ui

If the project doesn't use shadcn/ui yet, initialise it with Base UI. It detects app/global.css, adds the theme tokens and creates components.json:

npx shadcn@latest init --base=base
pnpm 11

create-fumadocs-app leaves a placeholder for esbuild under allowBuilds in pnpm-workspace.yaml, and pnpm 11 refuses to install anything until you replace it. Set it to esbuild: false first.

2. Install the components

Install @docscn/fumadocs-ui, which installs every docscn component into components/docs/ (but no routes):

npx shadcn@latest add @docscn/fumadocs-ui

If you added AI chat with fumadocs add ai, its UI in components/ai/chat/ imports from fumadocs-ui. Replace it with docscn's:

npx shadcn@latest add @docscn/ai-chat --overwrite

3. Change the imports

Replace fumadocs-ui/ with @/components/docs/ in your imports, in app/, components/ and lib/:

app/docs/layout.tsx
import { DocsLayout } from "fumadocs-ui/layouts/docs"; 
import { DocsLayout } from "@/components/docs/layouts/docs"; 

4. Remove Fumadocs UI's styles

Delete the fumadocs-ui/css/* imports from your global stylesheet. The docscn components installed their styles into the same file, built from your shadcn/ui theme:

app/global.css
@import "tailwindcss";
@import "fumadocs-ui/css/neutral.css"; 
@import "fumadocs-ui/css/preset.css"; 

5. Uninstall Fumadocs UI

npm uninstall fumadocs-ui

Then build the project. Pages, search, the OG image and Markdown routes keep working as before.

What's different

These are deliberate differences from Fumadocs UI:

Fumadocs UIdocscn
The slots prop on layouts and pagesNot supported. Edit your copy of the component instead.
--color-fd-* variables and fd-* utility classesYour shadcn/ui theme tokens (--background, --primary, --sidebar-*, ...). See Theming and typography.
Colour themes and CSS presets (neutral.css, preset.css, ...)Not shipped. Change your shadcn/ui theme instead.
The prose class (not-prose to opt out)docs-typeset (not-docs-typeset to opt out). Its sizes are relative, so prose prose-sm becomes docs-typeset text-sm.
fumadocs-ui/components/ui/* (button, tabs, popover, ...)Your own shadcn/ui primitives in components/ui/.
fumadocs-ui/components/sidebar/baseThe shadcn/ui sidebar. The docs and notebook layouts use SidebarProvider and SidebarInset, so useSidebar() works inside docs pages.
createPageTreeRenderer and createLinkItemRendererSidebarPageTree and SidebarLinkItem, rendered with the shadcn/ui sidebar menu.
Providers for React Router, TanStack Start, Waku and AstroNext.js only (provider/next).
Fumadocs UI's Radix UI variantBase UI only.
Deprecated props (nav.component, sidebar.tabs, ...)Not supported. Use the current props.
The sidebar's desktop collapse stateKept in shadcn/ui's sidebar_state cookie. Pass it to sidebar.defaultOpen to restore it on load.
⌘BToggles the sidebar, as in every shadcn/ui sidebar.
Hovering the edge of a collapsed sidebar shows itNot supported: the shadcn/ui sidebar slides away completely. Reopen it with the sidebar button or ⌘B.
Banner's layout offsetSet as --docs-banner-height instead of --fd-banner-height.
The notebook layout's width (centred, up to 97rem)The full width of the window, with the sidebar against its edge.
The aiChat panel takes the table of contents' placeDocked against the right edge of the window, beside the whole page. The table of contents hides while it's open.

Not supported yet

  • More layouts: the flux, glass and spacious layouts.
  • Search dialogs for Algolia and Orama Cloud. Build one from the search dialog parts.

Compatibility lists every Fumadocs UI module and its status.