npm / nextra-theme-docs
nextra-theme-docs
What changed in nextra-theme-docs 3 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-23.
102 breaking37 new APIs and options5 performance13 behavior and defaults1 tooling3 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initnextra-theme-docs 4112 changes
Breaking changes 74
Nextra 4 exclusively uses the Next.js App Router; Pages Router support has been discontinued.
Bleed moved from nextra-theme-docs to nextra/components for use in custom themes.
Collapse moved from nextra-theme-docs to nextra/components for use in custom themes.
collectCatchAllRoutes is removed.
The color-primary-750 theme color variant is removed.
compileMdx now returns Promise<string> instead of Promise<object>; use the returned string directly.
contentDirBasePath replaces useContentDir to configure the content directory under a catch-all subdirectory.
convertPageMapToJs is now synchronous.
createCatchAllMeta is removed from nextra/catch-all.
Details moved from nextra-theme-docs to nextra/components for use in custom themes.
The editLink.component option is removed.
editLink.content is replaced by the editLink option.
The Search prop errorText replaces error.
Generated MDX pages no longer contain export const title.
External links declared in _meta files open in a new tab, include rel="noreferrer", and display a ↗ suffix icon.
External Markdown links in MDX now open in a new tab, use rel="noreferrer", and display a ↗ suffix icon.
The feedback.useLink option is removed.
Folder gains a disabled prop when open is set, disabling click events and removing the pointer cursor.
The footer prop is removed; the notes direct users to pass Footer as a child of Layout.
getPageMap now accepts one optional root argument instead of lang and route arguments.
gitTimestamp is replaced by lastUpdated.
The theme.config head option is removed; configure dynamic head tags with the Next.js Metadata API or the Head component instead.
Head moved from nextra-theme-docs to nextra/components for use in custom themes.
The i18n.direction option is removed.
lastUpdated replaces gitTimestamp as the option for last-updated behavior.
Layout.banner is added as an optional prop.
Layout.footer is a required prop, replacing the earlier direction to pass Footer as a child.
Layout.navbar is a required prop, replacing the earlier direction to pass Navbar as a child.
The mdx-components file replaces the providerImportSource option for component setup.
MDXRemote replaces RemoteContent, is imported from nextra/mdx-remote, and receives default components automatically from mdx-components.jsx.
_meta files must be server component files without a 'use client' directive; zod parses and transforms them on the server.
Front matter fields are exported as an MDX metadata object; alternatively, export metadata directly, but do not use both in the same file.
TypeScript projects should set moduleResolution to bundler instead of node to avoid type errors.
The navbar prop is removed; the notes direct users to pass Navbar as a child of Layout.
Navbar.logo no longer has a default value and is now required.
The _meta newWindow field was removed.
Nextra 4 requires Next.js 14 or later.
Components formerly exported from the theme are now exported from
nextra/components.Import the theme stylesheet directly; it was previously imported under the hood.
Import the theme stylesheet in the application layout; it was previously imported under the hood.
The nextraCofig.transform option is removed.
The providerImportSource option is removed in favor of the mdx-components file.
normalizePageRoute is removed.
Search migrated from FlexSearch to Pagefind, with improved speed and support for indexing remote MDX, dynamic content, imported files, and static pages.
Install Pagefind as a dev dependency and run it after the build to index generated HTML pages.
Pagefind output is moved to public/_pagefind.
Remote docs setup now requires modifying the pageMap list in the layout file so sidebar navigation links display properly.
Nextra 4 uses the Next.js App Router and discontinues support for the Pages Router.
recmaRewriteFunctionBody is removed.
recmaRewriteJsx is removed.
renderComponent is removed.
renderString is removed.
The Search prop error is renamed to errorText.
Select moved from nextra-theme-docs to nextra/components for use in custom themes.
Sidebar titles now fall back to the first h1 Markdown heading after checking _meta, sidebarTitle, and title front matter.
SkipNavContent moved from nextra-theme-docs to nextra/components for use in custom themes.
SkipNavLink moved from nextra-theme-docs to nextra/components for use in custom themes.
Summary moved from nextra-theme-docs to nextra/components for use in custom themes.
Th, Tr, and Td are no longer standalone exports; use Table.Th, Table.Tr, and Table.Td instead.
The standalone Td export is removed; use Table.Td instead.
The standalone Th export is removed; use Table.Th instead.
The theme option was removed from the nextra configuration.
The theme.bottomContent field was removed.
Nextra 4 no longer supports theme.config files for configuring theme options.
The 'raw' layout option was removed; use page.{jsx,tsx} files to create pages without a layout.
The theme.topContent field was removed.
The themeConfig option was removed from the nextra configuration.
The themeConfig prop is removed from Layout.
themeSwitch.useOptions is refactored to the themeSwitch option.
The standalone Tr export is removed; use Table.Tr instead.
useContentDir is replaced by contentDirBasePath.
Nextra’s useRouter hook was removed; use useRouter from next/navigation instead.
Replace the useTOC export with a toc array export for supplying headings.
The Tailwind CSS prefix for theme classes changed from
_tox:; update overridden theme classes accordingly.
New APIs and options 23
Nextra 4 supports the App Router.
Set asIndexPage: true in front matter to use a page as the index for its folder.
Set the path from which content is served when using the content directory convention.
Use createIndexPage with getPageMap and MDXRemote to automatically render a route’s subpages as cards.
Add this attribute to the tag enclosing the main content area of JavaScript or TypeScript pages that should be indexed.
Add this attribute to tags whose content should be excluded from indexing.
A getPageMap helper function is added to nextra/page-map.
Markdown and MDX files can use GitHub alert syntax, which is rendered as Callout components.
The migration guide adds an app/layout.jsx root layout that composes the theme's Layout, Navbar, Footer, Banner, Head, and page map.
Create a root mdx-components.jsx file to define global MDX components, using the theme's useMDXComponents as the base.
mergeMetaWithPageMap is added to nextra/page-map.
A single .global _meta file can define pages across folders; folder items must include an items field.
Configure content width using the CSS custom property --nextra-content-width.
The page file convention supports MDX files using the enhanced App Router page extensions page.{md,mdx}.
A Rust-powered Pagefind search engine provides faster performance and better search results.
Translations can be dynamically loaded in server components and passed as props to theme components, avoiding client translation dictionary files.
Built-in internationalization now supports React Server Components for multilingual websites.
Search is exported from nextra/components for use in custom themes.
Nextra 4 supports Server/Client components.
A prefixed Tailwind CSS v4 layers stylesheet is exported for projects using Tailwind CSS v3.
Add --turbopack to the Next.js dev command to use Turbopack.
This option whitelists HTML elements to be replaced with components from mdx-components.js; by default, only details and summary are replaced.
Wrap the Pre component with withIcons to provide custom icons for code block languages.
Performance 3
Nextra 4 reports the smallest bundle size ever for a Nextra-powered website.
Imports from nextra/components, nextra-theme-docs, and nextra-theme-blog are optimized internally with Next.js optimizePackageImports to improve bundle size.
Nextra components and hooks are optimized by React Compiler, and internal uses of useCallback, useMemo, and memo were removed.
Behavior and default changes 8
Diff code blocks with a filename now use the icon corresponding to that filename’s extension.
JSX and TSX code blocks now display the React icon.
The built-in page now includes an issue-creation URL containing the referrer URL, helping identify which broken page led to a 404.
Page Map now collects static jsx and tsx pages from app/ in addition to static md and mdx pages.
Pages and _meta files in app, plus content folder files, are added to pageMap; dynamic pages beginning [[ are ignored.
Selection styles now use the primary color variant set through the color prop on <Head>.
Projects can use src/content and src/app directories.
Headings now animate when they are in the
:targetstate.
Tooling 1
Nextra 4 adds Turbopack support for an improved development experience.
Fixes and other changes 3
Fixes compatibility with Next.js 16.
Projects can use src/app and src/content directories.
Steps now supports h5 and h6 tags.
nextra-theme-docs 349 changes
Breaking changes 28
Renamed the theme option
banner.texttobanner.content.Removed the
imageprop; an image is shown based on the truthiness ofchildreninstead.Renamed the
primaryHuetheme option tocolor.hue.Renamed the
primarySaturationtheme option tocolor.saturation.Removed this configuration option.
Renamed the theme option
editLink.texttoeditLink.content.Removed the focus-visible polyfill.
Renamed the theme option
footer.texttofooter.content.Added frontmatter support for setting a page label in the sidebar; this replaces
frontmatter.sidebar_label.Use the
headoption instead ofnext-seoanduseNextSeoProps; its default is nownull.Renamed the theme option
i18n.texttoi18n.name.Removed the intersection-observer polyfill.
Removed the
MatchSorterSearchcomponent.Nextra now uses MDX3.
Support for
_meta.jsonwas removed; use_meta.{js,jsx,ts,tsx}instead.useMDXComponentsis now exported fromnextra/mdxinstead of the theme.The
removeLinksfunction moved fromnextra-theme-docstonextra/remove-links.The Tailwind prefix changed from
nx-to_to reduce bundle size.Removed
PageOpts.toc; use thetocprop fromcomponents.wrapper.The Next.js peer dependency requirement is now
>=13.React 18 is now the minimum requirement.
The project now uses
shikijiinstead ofshiki.Removed this option; use JSX to style separators and titles.
The
classNameprop now uses render props exposingselected,disabled, andhoverstate.The
loading,placeholder, andthemeSwitch.useOptionsdefault theme options are now limited to English.Renamed
pageOpts.headingstotoc.Removed this option; use JSX to customize headings in the table of contents.
Renamed
useSSGtouseData.
New APIs and options 14
Added a Nextra configuration option to import official theme CSS into a specific cascade layer.
Added a dark-mode background color theme option.
Added a light-mode background color theme option.
Menu items now accept a
Map, which guarantees insertion order.Added MathJax support.
Added the
useRouterhook entry point for accessing locale information.Added the
Playgroundcomponent.Added support for passing
recmaPluginsinmdxOptions.Added a theme option for bottom content.
Added a theme option for top content.
Exported the
useMenuhook.Added
useRouterfromnextra/hooksfor fetchinglocaleanddefaultLocale.Exported the
useThemeConfighook.Code blocks can disable the mobile word-wrap button with the
word-wrap=falsemetadata setting.
Performance 2
Search now loads
flexsearchdynamically to reduce bundle size.Mermaid is now loaded with a dynamic import.
Behavior and default changes 5
The docs theme
backToTopoption now supports i18n.The
iconprop is now optional.Code blocks without a specified language now default to plaintext to preserve formatting.
The default value is now
true.The
Tabcomponent is crawlable and indexable by search engines by default.