Why?
Taking some inspirations from Shadcn UI, I decided to make Fumadocs easier to use, with more APIs that simplify the design.
This is a large update.
New Features
Fumadocs CLI
Clone Fumadocs UI components to your workspace and modify them.
See docs for details.
Sidebar Tabs
Previously, multiple page tree is implemented with Fumadocs UI RootToggle
component.
You have to add it to the sidebar banner which isn't as intuitive as other APIs.
With Sidebar Tabs, by creating a root folder, Fumadocs will immediately add a tabs component to the sidebar.
Orama
We migrated the built-in search from Flexsearch to Orama, the same search engine that powers the Node.js docs site. It is open source, and also have their Cloud integration.
No changes required.
You can use our new createFromSource
API to create the route handler, which offers i18n support without any configurations.
In favour of this, the new search client of Fumadocs is introduced with support for different API clients. This includes Algolia, Orama (static and dynamic with route handlers).
See Search API.
Static Search
For sites with static export, you cannot use route handlers. We now support client-side search using search indexes generated during build time.
See Static Search.
Less Dependencies
I'm always working to reduce the dependencies required for Fumadocs, that is one reason why we separated Fumadocs into different packages.
Fumadocs UI now bundles icons from lucide-react
, for Next.js apps that is not using Lucide, they can avoid downloading the entire icon library.
And swr
is no longer used for search client, we implemented a light useQuery
hook with extra care on React performance optimization.
New Metadata Image API
To improve code organization, we made a Metadata Image API on Fumadocs Core. It is a tiny wrapper over Next.js Metadata API, composes seamlessly with Source API.
In favour of this, the getImageMeta
function from fumadocs-ui/og
has been removed.
Shorthands
As you may notice, we introduced more abstractions to reduce the setup steps required for enabling some features. It is also required for the code generator from Fumadocs CLI to work.
Like the generateParams
function, it enables zero-configuration i18n support for Next.js generateStaticParams
.
Better Card Component
Fumadocs UI Card can now support usage without href
.
You can pass children as React node, Typography styles will be applied correctly.
Better Category Component
The original DocsCategory
component was copied from our official docs, which is a very simple implementation that doesn't take page tree into account.
Now it accepts the source object via from
prop.
By default, it takes the locale
property from page
to find the corresponding page tree to traverse.
You can also force a page tree.
OpenAPI Tag Display Name
Change the display name with x-displayName
.
Better TypeScript Docs Automation
The AutoTypeTable
component now supports a type
prop, you can use TypeScript inside the field:
And code highlighting in typedoc is also supported with Shiki.
We highly recommend to use createTypeTable
instead of importing the component in MDX files, this allows a single instance of TypeScript Compiler API to be shared.
See Auto Type Table.
Next.js 15
Fumadocs v14 is compatible with Next.js 15, supporting sync and async usages of dynamic APIs.
Backward compatible
Next.js 14 is also supported, notice that guides/tutorials in the docs are mainly for Next.js 15.
UI Improvements
Navbar Links
The navigation menu on Home layout is redesigned, with better animation and flexibility.
See the new API.
Link Styles
You can escape Tailwind CSS Typography styles for the a
tag with data-card
attribute.
Disable Theme Switch
You can disable the default theme switcher with disableThemeSwitch
on layouts.
Breaking Changes
Move dir
option from defineDocs
Refactor Imports
Previous
New Import Path
Twoslash UI
We moved Twoslash UI components to fumadocs-twoslash
.
This isolates some logic from Fumadocs UI, allowing a better code organization.
Import the CSS styles and Popup
component differently.
Remove Deprecated APIs
The previous createI18nSearchAPIExperimental
is now renamed to createI18nSearchAPI
.
It takes the i18n config instead of scattering the options everywhere.
The types from fumadocs-core/search/shared
is moved to fumadocs-core/server
.
Written by
Fuma Nama
At
Thu Sep 19 2024