A modern, responsive documentation system for Dash applications built with Dash Mantine Components
A comprehensive boilerplate for creating beautiful, interactive documentation for your Dash components, data science workflows, and applications. Features markdown-driven content, live code examples, and automatic theme persistence.
- Write documentation in Markdown with Python integration
- Custom directives for interactive examples, code highlighting, and component props
- Automatic page generation from markdown files with frontmatter metadata
- Table of contents generation for easy navigation
- Built with Dash Mantine Components
- Responsive design for mobile, tablet, and desktop
- Dark and light theme support with automatic preference persistence
- Smooth transitions and professional styling
- Customizable color schemes and theming
- Hot reload during development
- Searchable component navigation
- Syntax highlighting for multiple languages
- Interactive code examples with live callbacks
- Component props documentation auto-generation
LLMS_DOCpattern β write a module-level prose string per page; served verbatim at/<page>/llms.txt- Multi-backend β
add_llms_routes(app)auto-detects Flask, FastAPI, or Quart and dispatches to the matching adapter - MCP bridge β each page's prose registers as a
dash.mcpresource on Dash 4.3+ (silent no-op otherwise) - SEO β
sitemap.xmlwith intelligent priority inference; respectsmark_hidden() - Bot management β training crawlers blocked (configurable), AI search citations allowed, browsers untouched
- Privacy controls β
mark_hidden()to exclude pages from sitemap, robots, MCP, and crawler prerender - Share with AI β paste the app URL into ChatGPT/Claude/etc.; they fetch the prose docs directly
- Powered by dash-improve-my-llms 2.0
- Run the same app on Flask, FastAPI, or Quart β switch with a single
DASH_BACKENDenvironment variable - Backend selection centralized in
lib/backend.py; a live badge shows which backend is serving the page - FastAPI/Quart (ASGI) unlock async callbacks, websocket callbacks, OpenAPI docs, a native JSON API (
/api/backend,/api/pages,/healthz), and ASGI middleware - Dedicated docs: Pluggable Backends, Backend Deep Dive, and a FastAPI Showcase
- Docker and docker-compose support
- Gunicorn (WSGI) and Uvicorn (ASGI) production servers
- Optimized for deployment
- Environment-based configuration
- Dash 4.2.0 - Modern Plotly Dash framework with pluggable backends
- DMC 2.7.0 - Dash Mantine Components
- Mantine 8.3.6 - Beautiful React UI library
- React 18 - Latest React features
- Python 3.11+ - Modern Python
- Python: 3.11 or higher
- Node.js: 14+ (for npm dependencies)
- npm: 6+
- dash >= 4.1.0
- dash-mantine-components >= 2.7.0
- dash-ag-grid
- dash-improve-my-llms[flask] >= 2.0.0
- flask >= 3.0.0 (default backend)
- plotly >= 5.0.0
- pandas >= 1.2.3
- pydantic >= 2.3.0
- python-frontmatter >= 1.0.0
- markdown2dash
- gunicorn >= 21.2.0 (WSGI production server)
Optional backends (install the matching extra to switch off Flask):
pip install "dash[fastapi]" # FastAPI (ASGI) backend
pip install "dash[quart]" # Quart (ASGI) backend
# then run with: DASH_BACKEND=fastapi python run.py (needs uvicorn)See requirements.txt for the complete list.
git clone https://github.com/pip-install-python/Dash-Documentation-Boilerplate.git
cd Dash-Documentation-BoilerplatePython packages:
pip install -r requirements.txtNode packages (for DMC frontend components):
npm installpython run.pyVisit http://localhost:8553 in your browser.
Create your documentation in the docs folder:
docs/
βββ your-component/
β βββ your-component.md # Markdown documentation
β βββ examples.py # Python code examples (optional)dash-documentation-boilerplate/
βββ assets/ # Static assets and CSS
β βββ m2d.css # Markdown-to-Dash styling (theme-aware)
β βββ main.css # Custom styles (theme-aware)
β βββ llms_copy.js # "Copy for LLM" button handler
β
βββ components/ # Reusable UI components
β βββ appshell.py # Main app layout with MantineProvider
β βββ header.py # Header with search and theme toggle
β βββ navbar.py # Navigation sidebar and drawer
β βββ backend_badge.py # Badge showing the active backend
β
βββ docs/ # Documentation content
β βββ example/ # Getting Started guide
β βββ directives/ # Custom Directives guide
β βββ interactive-components/ # Callback patterns guide
β βββ data-visualization/ # Theme-aware charts guide
β βββ ai-integration/ # AI/LLM integration (dash-improve-my-llms 2.0)
β βββ backends/ # Pluggable Backends guide
β βββ backend-comparison/ # Flask vs FastAPI vs Quart deep dive
β βββ fastapi-showcase/ # What the FastAPI backend unlocks
β
βββ lib/ # Utility libraries
β βββ constants.py # App-wide constants (APP_VERSION, colors)
β βββ backend.py # Backend selection (DASH_BACKEND)
β βββ asgi_middleware.py # ASGI middleware (FastAPI/Quart)
β βββ asgi_routes.py # Showcase routes (/healthz, /api/*)
β βββ analytics_tracker.py # Lightweight visitor analytics
β βββ directives/ # Custom markdown directives
β βββ kwargs.py # Component props table generator
β βββ source.py # Source code display directive
β βββ toc.py # Table of contents directive
β βββ llms_copy.py # "Copy for LLM" button directive
β
βββ pages/ # Dash multi-page app pages
β βββ home.md # Home page content
β βββ home.py # Home page layout (exports LLMS_DOC)
β βββ markdown.py # Dynamic markdown page loader
β
βββ templates/
β βββ index.html # SEO-optimized HTML template
β
βββ .gitignore
βββ CHANGELOG.md # Version history and changes
βββ Dockerfile # Docker container definition
βββ docker-compose.yml # Docker compose configuration
βββ package.json # Node.js dependencies
βββ package-lock.json # Locked npm versions
βββ README.md # This file
βββ requirements.txt # Python dependencies
βββ run.py # Application entry point
-
Create a new folder in the
docs/directory:mkdir -p docs/my-component
-
Create a markdown file with frontmatter:
--- name: My Component description: A description of my component endpoint: /components/my-component icon: mdi:code-tags --- ## My Component Your documentation content here...
-
Add interactive examples (optional):
# docs/my-component/example.py import dash_mantine_components as dmc component = dmc.Button("Click Me!", id="my-button")
-
Use directives in your markdown:
.. toc:: .. exec::docs.my-component.example .. source::docs/my-component/example.py
Generates a table of contents from your markdown headings.
Renders an executable Python component from a module.
Displays source code with syntax highlighting.
Generates a props documentation table for a component.
Adds a "Copy for LLM" button that copies the page's /<page>/llms.txt URL to the clipboard for sharing with ChatGPT, Claude, and other AI assistants.
Modify lib/constants.py to change the primary color:
PRIMARY_COLOR = "teal" # Change to any Mantine colorCustomize CSS in:
assets/main.css- General stylingassets/m2d.css- Markdown-specific styling
The boilerplate automatically saves user theme preference (light/dark) in localStorage:
- First visit: Detects browser preference or defaults to light
- Theme toggle: Saves preference automatically
- Return visits: Restores saved theme preference
docker build -t dash-docs-boilerplate .docker run -p 8550:8550 dash-docs-boilerplateVisit http://localhost:8550
docker-compose upThe app will be available at http://localhost:8550
The Docker container uses Gunicorn for production-ready serving:
- Multiple workers for better performance
- Automatic worker restart on failure
- Suitable for production environments
-
Create virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt npm install
-
Run in debug mode:
# Modify run.py app.run(debug=True, host='0.0.0.0', port='8553')
- Create your component in a separate module
- Add documentation in
docs/your-component/ - The app automatically discovers and registers pages from markdown files
- Restart the server to see your new documentation
Main layout components:
- Header:
components/header.py- Logo, search, theme toggle - Navbar:
components/navbar.py- Sidebar navigation - AppShell:
components/appshell.py- Overall layout structure
Create a .env file (optional):
DASH_DEBUG=False
DASH_HOST=0.0.0.0
DASH_PORT=8553
DASH_BACKEND=flask # flask | fastapi | quart (requires the matching dash extra)| File | Purpose |
|---|---|
lib/constants.py |
App-wide constants (colors, titles) |
assets/main.css |
Custom CSS styles |
templates/index.html |
HTML template (for analytics, meta tags) |
components/appshell.py |
Theme configuration, MantineProvider settings |
- Getting Started: This README
- Changelog: See CHANGELOG.md
- Examples: Check the
/docs/example/folder
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Test thoroughly: Ensure the app runs without errors
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Follow PEP 8 style guide for Python code
- Add docstrings to functions and classes
- Test your changes before submitting
- Update documentation if adding new features
- Keep commits atomic and well-described
Issue: ModuleNotFoundError: No module named 'dash_html_components'
- Solution: You're on an old version. Update to 1.0.0+ and import from the main package (
from dash import html, dcc); 1.0.0 runs on Dash 4.x.
Issue: DASH_BACKEND=fastapi (or quart) fails to start
- Solution: Install the matching extra β
pip install "dash[fastapi]"(or[quart]) β and serve with an ASGI server (uvicorn). The app falls back to Flask if the backend is unavailable.
Issue: Theme doesn't persist
- Solution: Check browser localStorage is enabled and not blocked
Issue: npm install fails
- Solution: Update Node.js to 14+ and npm to 6+
Issue: Port already in use
- Solution: Change port in
run.pyor stop the conflicting process
For more issues, check GitHub Issues
Current Version: 1.0.0
| Component | Version |
|---|---|
| Dash | 4.2.0 |
| Dash Mantine Components | 2.7.0+ |
| Mantine | 8.3.6 |
| Python | 3.11+ |
| React | 18.2.0 |
| Flask / FastAPI / Quart | pluggable backends |
| dash-improve-my-llms | 2.0.0+ |
See CHANGELOG.md for version history.
First stable release β a major architectural milestone:
- π Dash 4.x (4.2.0) and DMC 2.7.0 β modern framework with pluggable backends.
- π Pluggable backends: run the same app on Flask, FastAPI, or Quart by setting
DASH_BACKENDβ no code changes. ASGI backends add async/websocket callbacks, OpenAPI docs, a native JSON API, and ASGI middleware. New Pluggable Backends, Backend Deep Dive, and FastAPI Showcase docs. - π― dash-improve-my-llms 2.0: the
LLMS_DOCpattern (per-page prose served at/<page>/llms.txt), multi-backend AI/LLM surfaces, and an MCP resource bridge on Dash 4.3+. - π§Ή Removed the TOON format entirely β
lib/toon_generator.py, the TOON docs/dashboard, and/llms.toonroutes are gone (the package no longer exportsTOONConfig,toon_encode,generate_*_toon). β οΈ Removedmark_important()/mark_component_hidden()(now no-ops) and the/page.json//architecture.txtroutes β Dash 4.3 MCP covers structured introspection. Write emphasis directly into a page'sLLMS_DOCmarkdown.
This project is licensed under the MIT License - see the LICENSE file for details.
- Plotly Dash - The web framework
- Dash Mantine Components - Beautiful UI components
- Mantine - React component library
- dmc-docs - Documentation framework inspiration
- @AnnMarieW for suggested improvements
- The Dash community for continuous support
- Documentation: You're reading it!
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Dash Community: Plotly Community Forum
GitHub: @pip-install-python
YouTube: Pip Install Python
Check out open issues labeled good first issue
Made with β€οΈ by the Dash community
Pip Install Python LLC @ https://plotly.pro
Star this repo if you find it useful! β
