Docusaurus plugins are the primary extension mechanism for adding features to your site. Each plugin is a Node.js package that hooks into the Docusaurus build pipeline — loading content, generating routes, injecting scripts, and more. Presets are simply curated bundles of plugins and theme configurations published together for convenience.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.
Plugins vs. presets
A plugin is a single package that implements one feature (e.g. the docs system, a sitemap, Google Analytics). A preset groups multiple plugins and a theme under one install so you don’t have to wire them up individually.Most new Docusaurus projects use
@docusaurus/preset-classic, which bundles plugin-content-docs, plugin-content-blog, plugin-content-pages, plugin-sitemap, and theme-classic in a single dependency.docusaurus.config.js
Installing standalone plugins
If you need a plugin that is not included in your preset, install it separately and register it indocusaurus.config.js:
npm2yarn
docusaurus.config.js
docusaurus.config.js
Plugin execution order
Multiple plugin instances run in the order they appear in theplugins array. Preset plugins run after standalone plugins. Theme components are merged in reverse order, so the last theme wins for any given component.
Official plugins
Content plugins
These plugins load your source content from the filesystem and create pages for the theme to render.plugin-content-docs
The docs system with versioning, sidebars, and MDX support. Included in
preset-classic.plugin-content-blog
A full-featured blog with tags, authors, RSS/Atom feeds, and pagination. Included in
preset-classic.plugin-content-pages
Turns React and MDX files in
src/pages/ into standalone website pages. Included in preset-classic.Behavior plugins
These plugins enhance your site without managing page content directly.plugin-sitemap
Generates a
sitemap.xml for search engine crawlers. Included in preset-classic.plugin-pwa
Adds Progressive Web App support via Workbox — offline mode, install prompts, and service workers.
plugin-client-redirects
Creates client-side redirects for legacy URLs, emitting redirect HTML pages at build time.
plugin-ideal-image
Generates optimized, responsive images and adds lazy-loading via a custom React component.
plugin-debug
Exposes a
/__docusaurus/debug route with internal plugin data useful during development.plugin-svgr
Allows importing SVG files as React components using SVGR.
Analytics plugins
plugin-google-gtag
Integrates Google Analytics 4 (gtag.js) tracking into every page.
plugin-google-tag-manager
Integrates Google Tag Manager for flexible, consent-aware analytics.
plugin-google-analytics
Legacy Universal Analytics support (GA3). Prefer
plugin-google-gtag for new projects.@docusaurus/preset-classic bundle
The classic preset is the recommended starting point. It installs and configures these packages together:
| Package | Preset key |
|---|---|
@docusaurus/plugin-content-docs | docs |
@docusaurus/plugin-content-blog | blog |
@docusaurus/plugin-content-pages | pages |
@docusaurus/plugin-sitemap | sitemap |
@docusaurus/theme-classic | theme |
npm2yarn
When using
preset-classic, you do not need to install the bundled plugins separately. Configure them through the preset options object instead of the plugins array.