MUI Docs Infra

Warning

This is an internal project, and is not intended for public use. No support or stability guarantees are provided.

Docs Infra

Build-time optimized documentation infrastructure for React and Next.js sites. This package powers MUI's documentation with syntax-highlighted code demos, auto-extracted TypeScript API references, and client-side search.

Key Features

  • Code Demos with syntax highlighting, multiple variants (CSS Modules, Tailwind), and live previews
  • Type Documentation automatically extracted from TypeScript at build time
  • Search with Orama-powered client-side indexing
  • Zero runtime overhead - heavy processing happens during build via webpack loaders

Core Concepts

New to the codebase? Start with the Architecture page to understand how the build-time optimization, factory pattern, and data flows work together.

Installation

pnpm install @mui/internal-docs-infra

Then configure your Next.js app with withDocsInfra:

import { withDocsInfra } from '@mui/internal-docs-infra/withDocsInfra';

export default withDocsInfra()(nextConfig);

Documentation

  • Architecture - System design, data flows, and key decisions
  • Components - CodeHighlighter, CodeProvider, context providers
  • Hooks - useCode, useDemo, useTypes, useSearch
  • Commands - CLI tools for validation
  • Factories - createDemo, createTypesMeta, factory patterns
  • Pipeline - Loaders, transformers, enhancers, and build-time tools
  • Patterns - Architectural patterns and best practices
  • Conventions - Filesystem and coding conventions

Contributing

See the Contributing guide.

License & Use

This project is licensed under the MIT License.

Warning

This is an internal project, and is not intended for public use. No support or stability guarantees are provided.