Description List
Description list (term/detail pairs) component.
Preview
- Framework
- Language
Arguments
description_list(items=[{'term': 'Framework', 'description': 'Django'}, {'term': 'Language', 'description': 'Python'}])Usage
views.py
python
from djust import LiveView
from djust.components import DescriptionList
class MyView(LiveView):
template_name = "my_template.html"
def mount(self, request, **kwargs):
self.component = DescriptionList(items=[{'term': 'Framework', 'description': 'Django'}, {'term': 'Language', 'description': 'Python'}])my_template.html
django
{{ component }}Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| items | list | None | None | list of dicts with keys: term, detail |
| layout | str | 'vertical' | vertical, horizontal |
| 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.description_list | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 4 of this component's classes at line 1111, 1112, 1113, 1114. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |