Component System
Unfold components are rendered using Django’s template system with the{% component %} template tag. Components are designed to be flexible and composable, allowing you to build complex interfaces from simple building blocks.
Basic Usage
Components are included in templates using the{% component %} tag:
Component Registry
Unfold uses a component registry system for Python-based components that need to process request data:Available Components
Unfold includes the following built-in components:Card
Container component for grouping related content with optional title, footer, and actions
Button
Interactive button component with multiple variants and states
Table
Display tabular data with headers, responsive layout, and optional collapsible rows
Progress
Visualize progress or percentage values with customizable bars
Tracker
Display time-series data in a compact grid format (e.g., contribution graphs)
Layer
Generic wrapper component for custom layouts and compositions
Component Props
Most components accept common properties:class- Additional CSS classes to applytitle- Component title or headingchildren- Nested content within the component
Using Components in Admin
Components can be used in various parts of the Django admin:Custom Admin Views
Template Sections
Change Form Templates
Components can be used in custom change form templates by overriding the default templates.Component Composition
Components can be nested to create complex layouts:Styling Components
Components use Tailwind CSS classes and follow Unfold’s design system. You can customize appearance using:- The
classparameter for additional CSS classes - Theme configuration in
settings.py - Custom CSS in your project
Next Steps
Explore individual component documentation to learn about specific features and usage:- Card Component - Container and layout
- Button Component - Interactive elements
- Table Component - Data display
- Progress Component - Progress indicators
- Tracker Component - Activity tracking
- Layer Component - Custom layouts