Data Card Grid
Filterable card grid layout.
Preview
Alpha
First example project.
Beta
Second example project.
Gamma
Third example project.
Arguments
data_card_grid(columns=3, items=[{'title': 'Alpha', 'description': 'First example project.', 'category': 'Web'}, {'title': 'Beta', 'description': 'Second example project.', 'category': 'Web'}, {'title': 'Gamma', 'description': 'Third example project.', 'category': 'CLI'}])Usage
views.py
python
from djust import LiveView
from djust.components import DataCardGrid
class MyView(LiveView):
template_name = "my_template.html"
def mount(self, request, **kwargs):
self.component = DataCardGrid(columns=3, items=[{'title': 'Alpha', 'description': 'First example project.', 'category': 'Web'}, {'title': 'Beta', 'description': 'Second example project.', 'category': 'Web'}, {'title': 'Gamma', 'description': 'Third example project.', 'category': 'CLI'}])my_template.html
django
{{ component }}Parameters
| Name | Type | Default |
|---|---|---|
| items | List[dict] | None | None |
| columns | int | 3 |
| filter_key | str | 'category' |
| event | str — renames the event; identity is `name` | '' |
| custom_class | str | '' |
| **kwargs | — passed to `Component.__init__`: `name=` identifies the instance in the events it sends, `id=` sets `component.id`, and any other keyword is kept as state | — |
Source & styles
| File | Path | Notes |
|---|---|---|
| module | djust.components.components.data_card_grid | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 9 of this component's classes at line 2365, 2366, 2367, 2369, 2370, 2371, 2374, 2375, 2376. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |