Docusaurus Swizzle
Quick Start
Swizzle components to customize Docusaurus theme behavior:
bash
npm run swizzle @docusaurus/theme-classic ComponentName -- --wrap
Core Principles
- •Wrap (safe): Extends original component, easier to upgrade
- •Eject (unsafe): Full copy for maximum control, harder to maintain
- •Interactive mode: Use
npm run swizzleto browse available components - •Swizzled components go in
src/theme/ComponentName/
Common Patterns
List available components:
bash
npm run swizzle @docusaurus/theme-classic -- --list
Commonly swizzled: Footer, Navbar, DocItem, DocSidebar, TOC
Reference Files
For detailed documentation, see:
- •references/commands.md - All swizzle commands and options
- •references/components.md - Component-specific guides
Notes
- •Prefer
--wrapfor minor changes to maintain upgrade compatibility - •Test thoroughly after swizzling components
- •Check official docs for component-specific swizzle safety ratings