Rich Select
Select dropdown where each option can include icons, images, descriptions,
Preview
Select...▾
Usage
views.py
python
from djust import LiveView
from djust.components import RichSelect
class MyView(LiveView):
template_name = "my_template.html"
def mount(self, request, **kwargs):
self.component = RichSelect()my_template.html
django
{{ component }}Parameters
| Name | Type | Default |
|---|---|---|
| name | str | '' |
| options | List[Dict] | None | None |
| value | str | '' |
| event | str — renames the event | '' |
| placeholder | str | 'Select...' |
| disabled | bool | False |
| searchable | bool | False |
| label | str | '' |
| variant_map | Dict[str, str] | None | None |
| **kwargs | — passed to `Component.__init__`: `id=` sets `component.id`, and any other keyword is kept as state | — |
Source & styles
| File | Path | Notes |
|---|---|---|
| module | djust.components.components.rich_select | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 5 of this component's classes at line 1118, 1120, 1123, 1125, 1126. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |