Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/facebook/docusaurus/llms.txt

Use this file to discover all available pages before exploring further.

@docusaurus/theme-classic is the default and only production-ready Docusaurus main theme. It delivers a complete documentation site UI out of the box: responsive navbar, footer, collapsible sidebar, table of contents, breadcrumbs, version banners, doc and blog layouts, MDX page rendering, syntax-highlighted code blocks, and more. The theme is built on Infima, a purpose-built CSS framework for documentation, and exposes dozens of CSS custom properties so you can reskin the site without touching any component source code.

Installation

If you are using @docusaurus/preset-classic, theme-classic is already installed and configured. You do not need to install it separately.
npm install --save @docusaurus/theme-classic
Register the theme explicitly only if you are not using the preset:
docusaurus.config.js
export default {
  themes: ['@docusaurus/theme-classic'],
};

Configuration

theme-classic accepts a single plugin-level option:
OptionTypeDefaultDescription
customCssstring | string[][]One or more CSS files to import globally as client modules. Paths are relative to the site directory.
The vast majority of visual configuration — navbar, footer, color mode, Prism syntax highlighting — lives in themeConfig, not in the plugin options above. See the Theme Configuration reference for details.

Infima CSS integration

theme-classic imports Infima’s default stylesheet automatically. Infima is a component-based CSS framework that uses CSS custom properties extensively, making it straightforward to restyle the entire site by overriding a small set of variables in your custom CSS file. The most important Infima variables to override are the primary color shades. Infima expects you to provide the full 0–9 scale:
src/css/custom.css
:root {
  --ifm-color-primary: #2e8555;
  --ifm-color-primary-dark: #29784c;
  --ifm-color-primary-darker: #277148;
  --ifm-color-primary-darkest: #205d3b;
  --ifm-color-primary-light: #33925d;
  --ifm-color-primary-lighter: #359962;
  --ifm-color-primary-lightest: #3cad6e;
  --ifm-code-font-size: 95%;
}
Use the Infima color generator to produce the full primary color scale from a single hex value.

Dark mode CSS variables

Override variables inside the [data-theme='dark'] selector to apply dark-mode-specific values:
src/css/custom.css
[data-theme='dark'] {
  --ifm-color-primary: #25c2a0;
  --ifm-color-primary-dark: #21af90;
  --ifm-color-primary-darker: #1fa588;
  --ifm-color-primary-darkest: #1a8870;
  --ifm-color-primary-light: #29d5b0;
  --ifm-color-primary-lighter: #32d8b4;
  --ifm-color-primary-lightest: #4fddbf;
}

Commonly used CSS variables

VariablePurpose
--ifm-color-primaryMain accent color (links, buttons, active states)
--ifm-font-family-baseBody font stack
--ifm-font-family-monospaceCode font stack
--ifm-font-size-baseBase font size
--ifm-line-height-baseBase line height
--ifm-navbar-heightHeight of the top navbar
--ifm-sidebar-widthWidth of the doc sidebar
--ifm-toc-border-colorColor of the table of contents border
--ifm-code-font-sizeFont size inside inline and block code
--docusaurus-highlighted-code-line-bgBackground for highlighted code lines

Swizzlable components

Every component in the table below can be replaced or wrapped with your own version using npx docusaurus swizzle. Components marked safe have a stable interface; unsafe components may change between minor releases.
# List all swizzlable components and their safety status
npx docusaurus swizzle @docusaurus/theme-classic --list
ComponentDescription
LayoutRoot page wrapper; includes <html>, <head>, and <body> structure
NavbarTop navigation bar
NavbarItemIndividual item inside the navbar
FooterSite-wide footer
SkipToContentAccessibility skip link at the top of the page
BackToTopButtonFloating button that scrolls back to the top
AnnouncementBarDismissible banner shown above the navbar
ThemeProviderProvides color mode context to the whole tree
LogoSite logo used in navbar and footer
ColorModeToggleLight/dark mode switch
ComponentDescription
DocItemRoot layout for an individual documentation page
DocRootContainer that hosts the sidebar and doc content area
DocsRootTop-level docs wrapper (handles versioning context)
DocSidebarThe collapsible sidebar used on doc pages
DocSidebarItemA single item (link, category, or HTML) inside the sidebar
DocSidebarItemsRenders a list of sidebar items
DocBreadcrumbsBreadcrumb navigation at the top of a doc page
DocPaginatorPrevious / next navigation at the bottom of a doc page
DocVersionBadgeBadge that shows the active docs version
DocVersionBannerBanner warning when browsing a non-latest version
DocVersionRootProvides version context to doc pages
DocCardCard used in generated category index pages
DocCardListGrid of DocCard components
DocCategoryGeneratedIndexPageAuto-generated landing page for a sidebar category
DocTagsListPagePage listing all doc tags
DocTagDocListPagePage listing docs that share a given tag
EditThisPage”Edit this page” link pointing to the source file
EditMetaRowRow combining “Edit this page” and “Last updated”
LastUpdatedDisplays the last-updated timestamp
ComponentDescription
BlogLayoutRoot layout for all blog pages
BlogListPagePage listing recent blog posts
BlogListPaginatorPagination controls on blog list pages
BlogPostItemSummary card for a single post on the list page
BlogPostItemsRenders a list of BlogPostItem components
BlogPostPageFull layout for reading a single blog post
BlogPostPaginatorPrevious / next navigation within blog posts
BlogSidebarSidebar shown on blog pages
BlogTagsListPagePage listing all blog tags
BlogTagsPostsPagePage listing posts for a specific tag
BlogArchivePageChronological archive of all blog posts
ComponentDescription
CodeBlockSyntax-highlighted fenced code block
CodeInlineInline code span
MDXComponentsMaps HTML element names to React components for MDX
MDXContentWraps MDX page content
MDXPageFull page layout for standalone MDX pages
AdmonitionRenders :::note, :::tip, :::warning, etc.
DetailsExpandable <details> / <summary> element
HeadingSection heading with anchor link
TabsTabbed content container
TabItemIndividual tab pane inside Tabs
ThemedImageImage that swaps src based on the active color mode
MermaidPlaceholder component (replaced by theme-mermaid)
ComponentDescription
TOCFixed table of contents shown on the right side of doc pages
TOCCollapsibleCollapsible TOC used on mobile
TOCInlineInline TOC that can be embedded anywhere in content
TOCItemsRenders the list of heading links inside any TOC variant
ComponentDescription
TagPill-shaped tag component
TagsListByLetterAlphabetical tag listing
TagsListInlineCompact inline tag list
IconWrapper for SVG icon sprites bundled with the theme
SearchBarSearch bar slot (populated by a search theme)
SearchMetadataInjects Algolia meta tags when search theme is active
SiteMetadataInserts global <meta> and <link> tags
ContentVisibilityControls deferred rendering for off-screen content
NotFound404 error page
ErrorPageContentContent rendered inside the error boundary
PaginatorNavLinkSingle previous/next link used by paginators

RTL support

theme-classic ships RTL-transformed versions of the Infima stylesheet and uses postcss-rtlcss to transform your custom CSS at build time whenever the active locale is configured with direction: 'rtl'. No extra setup is needed beyond locale configuration.

Build docs developers (and LLMs) love