Docusaurus themes control the visual presentation and user interface of your documentation site. Unlike plugins, which add data-processing capabilities and content sources, themes contribute React components and global CSS that determine what visitors actually see and interact with. Every Docusaurus site needs at least one main theme to render its pages; enhancement themes layer on top to add features such as search and interactive code playgrounds.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.
Themes vs. plugins
The distinction between themes and plugins in Docusaurus is subtle but important. Both are packages that hook into the Docusaurus lifecycle, but they serve different roles:| Aspect | Plugins | Themes |
|---|---|---|
| Primary purpose | Load and transform content | Provide UI components and styles |
| Contributes routes | Yes (via addRoute) | Rarely |
| Contributes components | No | Yes (via theme path) |
| Example | plugin-content-docs | theme-classic |
The component override (swizzling) system
Docusaurus allows you to replace or wrap any theme component with your own version — a process called swizzling. This gives you fine-grained control over every element of the UI without forking the entire theme.- Eject (replace)
- Wrap
Ejecting copies the original component source into your site’s
src/theme/ directory, where you can modify it freely.src/theme/ComponentName/index.js takes precedence over the package’s version. Docusaurus resolves theme components using an alias chain: your site overrides → theme package → fallback defaults.
Official themes
Docusaurus ships several official themes, split into main themes (which provide a complete UI) and enhancement themes (which augment an existing main theme).Main themes
@docusaurus/theme-classic
The production-ready default theme used by most Docusaurus sites. Provides a full UI including navbar, footer, sidebar, table of contents, doc layout, blog layout, search bar slot, and all standard page types. Built on the Infima CSS framework and fully customizable via CSS variables. Included automatically when you use
@docusaurus/preset-classic.Additional main themes are planned for the future. The goal is for all main themes to share the same features, configuration API, and user experience, differing only in visual design and styling framework. As of now, only
theme-classic is production-ready.Enhancement themes
Enhancement themes add specific capabilities on top of any main theme. They do not provide a complete UI on their own.@docusaurus/theme-live-codeblock
Powers interactive, editable code blocks in your MDX content using react-live. Add
live to any code fence to make it executable in the browser. Configure the playground position via themeConfig.liveCodeBlock.playgroundPosition.@docusaurus/theme-search-algolia
Integrates Algolia DocSearch into your site’s navbar. Provides a
SearchBar component and a dedicated search results page at /search. Requires Algolia credentials configured in themeConfig.algolia.@docusaurus/theme-mermaid
Renders Mermaid diagrams defined in fenced code blocks with the
mermaid language tag. Requires enabling the Remark plugin via markdown.mermaid: true in docusaurus.config.js.Installation and usage
Most Docusaurus users install themes through the@docusaurus/preset-classic preset, which bundles theme-classic and theme-search-algolia together. If you need an enhancement theme separately, install it as a package and register it under the themes key in your config.
docusaurus.config.js
Theme configuration
All theme visual options — color mode, navbar, footer, code highlighting, and table of contents — are set inside thethemeConfig object in docusaurus.config.js. See the Theme Configuration reference for a complete field listing.