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-blog exports a focused set of components designed for content-first blog sites. Unlike the docs theme, there is no configuration object — every component is controlled through props. This page documents each named export from the package and shows how they compose into a full blog UI.
Imports
All components are available as named exports:Navbar
Renders a site header that auto-generates navigation links from thepageMap for all top-level pages, then renders any custom children after them.
Props
The full page map returned by
getPageMap() from nextra/page-map.
<Navbar> uses normalizePages internally to extract the top-level
navigation items and render them as links.Extra elements rendered after the auto-generated page links — useful for
adding an RSS link, a theme toggle button, or an external link icon.
Example
app/layout.tsx
PostCard
Renders a single blog post preview card showing the post title (as a link), description with an optional “Read More” link, and the formatted publication date. Use this component in a post listing page to iterate over all posts fromgetPageMap.
Props
An object containing the post’s route and frontmatter.
Text of the “read more” link appended after the description. Set to an empty
string or
undefined to suppress the link.Example — post listing page
app/posts/page.tsx
ThemeSwitch
A client-side dark/light mode toggle button that usesnext-themes under the
hood. Renders a sun or moon icon depending on the currently resolved theme.
ThemeSwitch takes no props — it reads and sets the theme entirely through
next-themes’ useTheme hook.
Example
Unlike the docs theme’s
ThemeSwitch, the blog ThemeSwitch is a simple
icon button that toggles between 'dark' and 'light' — it does not have a
'system' option dropdown.Comments
Integrates Cusdis — an open-source, privacy-focused comment system — into a blog post page. The component embeds the Cusdis iframe and automatically syncs the iframe’s theme with the page’s active color scheme.Props
Your Cusdis application ID from the Cusdis dashboard.
The component logs a console warning and renders nothing when this prop is
missing.
The Cusdis host URL. Override this when self-hosting Cusdis on your own
domain.
Example
app/posts/[slug]/page.tsx
useMDXComponents
Returns the default MDX component map used by the blog theme. Pass this to yourmdx-components.tsx file to apply the blog’s prose styles to all MDX
content.
Usage
mdx-components.tsx
ReadingTime type
The ReadingTime type is exported from the package for use with reading-time
display utilities. It is automatically injected into each post’s frontMatter
when the remark-reading-time plugin is configured.
Human-readable reading time, e.g.
'3 min read'.Decimal minutes, e.g.
3.2.Reading time in milliseconds, e.g.
192000.Total word count of the post, e.g.
640.Display example
app/posts/[slug]/page.tsx
Full post listing example
The following ties all blog components together in a realistic post listing page:app/page.tsx
useTheme()
Re-exported directly from next-themes. Returns the current theme state and a setter for toggling between themes in client components.
useTheme is a convenience re-export. You can also import it directly from
next-themes — the behaviour is identical. The <ThemeSwitch> component
uses this hook internally to toggle between 'dark' and 'light'.