A minimal Dash starter template demonstrating modern Python best practices with a clean, production-ready structure.
Current Implementation: Single production-ready app using Dash Mantine Components (DMC)
- Active:
src/dash_lite/- DMC-based implementation with dark/light theme switching
This project has consolidated to focus on the DMC implementation as the primary, maintained version.
- 🎨 Modern UI with Dash Mantine Components
- 🌓 Dark/Light Theme switching with persistence
- 🏗️ Clean Architecture using app factory pattern
- 📦 Type-Safe with full type hints
- 🚀 Production-Ready with environment variable configuration
- Python >= 3.10
- Poetry (recommended) or pip
# Clone the repository
git clone https://github.com/j-paro/dash-lite.git
cd dash-lite
# Install dependencies with Poetry
poetry install
# Or with pip
pip install -e .# Using the entry point
poetry run dashlite
# Or directly
poetry run python -m dash_lite.appThe app will start on http://localhost:8052 by default.
Control app behavior via environment variables:
DASH_LITE_PORT- Server port (default:8052)DASH_LITE_DEBUG- Debug mode (default:true)
# Example: Run on different port
$env:DASH_LITE_PORT="9000"; poetry run dashlitedash-lite/
├── src/
│ └── dash_lite/ # Main application
│ ├── __init__.py
│ ├── app.py # App factory & entry point
│ ├── layout.py # UI component structure
│ └── callbacks.py # Interactive logic
├── deprecated/ # Legacy implementations (not maintained)
│ ├── original/ # Vanilla Dash + CSS
│ └── using_tailwind/ # Tailwind CSS version
├── .github/
│ ├── copilot-instructions.md
│ └── instructions/ # Coding standards & guides
├── pyproject.toml # Dependencies & config
└── README.md
Each module follows a clean separation of concerns:
app.py - Application creation and configuration
def create_app() -> Dash:
"""Create and configure the Dash app."""
app = Dash(__name__, title="dash-lite starter (Mantine)")
app.layout = dmc.MantineProvider(create_layout())
register_callbacks(app)
return applayout.py - UI component structure
- Pure layout definition
- No callback logic
- DMC components wrapped in
MantineProvider
callbacks.py - Interactive behavior
def register_callbacks(app: Dash) -> None:
"""Register all callback functions."""
@app.callback(...)
def update_greeting(...):
...This template uses current Dash best practices:
- ✅
ctx.triggered_idfor trigger detection (not deprecatedcallback_context) - ✅ Individual callback inputs as arguments (not lists)
- ✅ Type hints on all functions
- ✅ Clientside callbacks for performance
- ✅ Component state persistence
Core dependencies (from pyproject.toml):
- dash >= 3.3.0 - Core framework
- dash-mantine-components >= 2.4.0 - UI component library
- dash-iconify >= 0.1.2 - Icon support
This project follows:
- PEP 8 formatting (4 spaces, 79 char lines)
- PEP 257 docstring conventions
- Type hints on all functions
- Modern Dash patterns (see
.github/instructions/python.instructions.md)
See TESTING.md for information on running tests and test coverage.
See TOOLS.md for available development tools and utilities
When working with Dash Mantine Components:
- Always wrap layout in
dmc.MantineProvider - Use DMC layout components (
dmc.Stack,dmc.Group,dmc.Paper) - Leverage built-in theming instead of custom CSS
- String literals for font weights (
"bold"not500)
See .github/instructions/dmc.instructions.md for comprehensive component reference.
The included demo app showcases:
- Component Selection -
dmc.Selectdropdown for greeting styles - Text Input -
dmc.TextInputwith validation - Dynamic Output - Callback-driven content updates
- Theme Switching - Persistent dark/light mode toggle
- Responsive Layout - Container-based structure
dash-lite prioritizes:
- ✨ Simplicity - Minimal dependencies, clear structure
- 📚 Education - Demonstrates best practices
- 🚀 Speed - Get building quickly
- 🔧 Flexibility - Easy to extend or strip down
This is not:
- ❌ A full-featured dashboard framework
- ❌ An opinionated state management system
- ❌ A component showcase (see Mantine docs for that)
Want to share your app with the world? See PYTHONANYWHERE.md for instructions on deploying to PythonAnywhere's free tier.
MIT
This is a starter template. Fork it and make it your own!
