Documentation 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.
nextra-theme-docs ships several standalone components alongside the main <Layout> wrapper. Most are designed to be instantiated once in your root layout and passed as props, but they can also be imported and used anywhere in your application. This page covers every named export from the package.
Navbar
The<Navbar> component renders a sticky top navigation bar with a logo, optional project/chat icon links, and a slot for custom children.
<Layout navbar={...}>.
Props
The logo element rendered on the left side of the navbar (or right when
align="left"). Can be any React content — an image, SVG, or text node.Controls whether the logo is wrapped in a link. Pass
true (default) to link
to /, a custom string to link to a different URL, or false to render the
logo without any link.URL of the project’s primary repository or homepage. When provided, a
GitHub icon button is rendered. Defaults to no button when omitted.
Custom icon element for the project link button. Replace with a GitLab,
npm, or any other SVG when your project lives outside GitHub.
URL to a community chat or social link (Discord, X/Twitter, Slack, etc.). A
Discord icon button is rendered when this prop is set.
Custom icon element for the chat link button.
Side to which navigation icon links are aligned inside the navbar.
Additional CSS class names applied to the
<nav> element.Extra elements rendered after the icon link buttons — useful for adding a
custom search bar, a CTA button, or additional icon links.
Example
app/layout.tsx
Footer
The<Footer> component renders the site footer. It already contains locale and theme switchers internally; pass children for copyright text or additional footer content.
Props
Content rendered inside the
<footer> element — typically copyright text and
links. When children is omitted, only the theme/locale switcher row is shown.Additional CSS class names applied to the inner
<footer> element.<Footer> accepts all standard HTML <footer> element attributes in addition
to the documented props above, since it spreads ComponentProps<'footer'>.Example
app/layout.tsx
NotFoundPage
<NotFoundPage> provides the default content for a 404 error page. It renders a centred “Page Not Found” heading and a link that opens a pre-filled GitHub issue, helping visitors report broken links.
app/not-found.tsx file and render this component:
app/not-found.tsx
Props
Label text of the issue-submission link rendered below the heading.
Set to
null to suppress the link entirely.GitHub issue label(s) pre-applied to the new issue created when a visitor
clicks the link. Separate multiple labels with commas.
Top content of the 404 page. Defaults to a styled
<h1> heading. Replace to
customise the heading text or add an illustration.Additional CSS class names applied to the wrapping
<div>.ThemeSwitch
A standalone dark/light/system theme selector dropdown. By default the<Footer> already embeds this component, but you can also render it in a custom toolbar or page header.
Props
When
true, the current theme label text is hidden and only the icon is shown,
producing a compact icon-only button suitable for tight layouts.Additional CSS class names applied to the selector wrapper.
ThemeSwitch respects the darkMode flag from <Layout>. When darkMode
is false, the component renders nothing.LocaleSwitch
A locale/language selector dropdown. It reads thei18n configuration from the theme config store and redirects the browser to the same path in the selected locale.
Props
When
true, only the globe icon is shown — the locale display name is hidden.
Useful inside compact navbars.Additional CSS class names applied to the selector wrapper.
LastUpdated
Renders the last-updated date for the current page. Used in the TOC panel to communicate content freshness. The component automatically picks up the active locale wheni18n is configured.
<Layout lastUpdated={...}> to control locale and label text:
Props
The date to display. When not provided (or
undefined), the component renders
nothing. Nextra automatically injects the git-derived last-modified date.A BCP 47 locale string used to
format the date via
Date.prototype.toLocaleDateString. When i18n is
configured, the active route locale is used instead.Prefix text rendered before the formatted date.
Hooks
nextra-theme-docs exposes several React hooks for reading and updating theme state inside client components.
useThemeConfig()
Returns the full, resolved theme configuration object — the merged result of all props passed to <Layout>.
useConfig()
Returns normalised data for the current page derived from the page map.
The full result of
normalizePages() for the active route, including
activeType, activeThemeContext, flatDirectories, and more.true when the sidebar should be hidden on the current page — either because
the active page’s themeContext.sidebar is false, or the page type is
'page'.useMenu() / setMenu()
Controls the mobile navigation menu open state.
Returns
true when the mobile menu is open.useTheme()
Re-exported directly from next-themes. Returns { theme, resolvedTheme, setTheme, ... }.
Link
A styled anchor component that wraps theAnchor primitive from nextra/components and applies the docs theme’s primary-color underline styles. Use it inside MDX content or custom components whenever you want a link that automatically matches the docs theme.
Link accepts all the same props as Anchor (and therefore <a>), including href, target, rel, and className. Any className you provide is merged with the theme’s default link styles.
useMDXComponents()
Returns the complete MDX component map used by the docs theme — headings, links, code blocks, tables, callouts, and more. Pass it to your mdx-components.tsx file to apply docs-theme prose styles to all MDX content in your project.
Usage
mdx-components.tsx