TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/shuding/nextra/llms.txt
Use this file to discover all available pages before exploring further.
<Layout> component is the top-level wrapper for every nextra-theme-docs site. You pass it to your root app/layout.tsx file alongside a pageMap and any optional configuration props, and it orchestrates the entire documentation shell — sidebar, navbar, footer, search, TOC, theming, and navigation links — automatically.
<Layout> uses Zod to validate its props at runtime. Invalid prop
values (for example a docsRepositoryBase that does not start with https://)
will throw a descriptive error during development.Import
Usage Example
Props
Required props
The page content rendered inside the documentation shell. In the App Router this
is the
{children} slot automatically provided by Next.js to every layout.The full page map of your documentation site. Always pass the result of the
getPageMap() call from nextra/page-map. Nextra uses this to build the
sidebar, navigation, and breadcrumb.Navbar & Footer
A rendered
<Navbar> component. Pass a
pre-instantiated element so you can co-locate all navbar configuration in one
place.A rendered
<Footer> component. The footer
area already includes locale and theme switchers; pass children to the Footer
component for copyright text or additional links.A rendered
<Banner> component from nextra/components used for site-wide
announcements displayed above the navbar. Omit this prop entirely if you do not
need a banner.Repository & Links
Base URL of the documentation repository. Must begin with
https://. Used to
auto-generate the Edit this page link and the Feedback link that appears
in the TOC panel.For a monorepo or non-root path, include the full tree path:Content rendered inside the edit link shown at the bottom of the TOC. Set to
null to disable the link entirely.Configuration for the inline feedback link that opens a pre-filled GitHub issue.
Search
The search component rendered in the navbar. Defaults to the built-in
<Search /> from nextra/components. Replace with a custom component or set
to null to disable search entirely.Dark Mode & Theming
Show or hide the dark mode toggle. When
false, the theme-switch dropdown is
hidden from both the sidebar footer and the standalone <ThemeSwitch> component.Localisation strings for the theme-switch dropdown options.
Configuration passed directly to the underlying
next-themes <ThemeProvider>.Sidebar
Controls the appearance and behaviour of the documentation sidebar.
Table of Contents (TOC)
Configuration for the in-page Table of Contents panel shown on the right side
of the content area.
Navigation
Controls the previous/next page navigation links shown at the bottom of each
page. Pass
true/false to enable or disable both links at once, or pass an
object to control them individually.Miscellaneous
Show or hide the Copy page content button that appears at the top of the
content area, allowing users to copy the full page text to the clipboard.
A
<LastUpdated> element used to render the last-updated timestamp beneath
each page. Must be a <LastUpdated> component — plain strings or other
elements are rejected at runtime.Language switcher configuration. Each entry maps a Next.js locale string (from
next.config i18n.locales) to a human-readable display name shown in the
dropdown. When the array is empty, the locale switcher is hidden.Full configuration example
The example below shows a production-ready root layout with all commonly used props configured:app/layout.tsx