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 | Description |
|---|---|---|---|
| name | str | '' | form field name |
| options | List[Dict] | None | None | list of dicts with keys: value, label, and optional icon, image, description, badge, variant |
| value | str | '' | currently selected value |
| event | str — renames the event | '' | dj-click event name for selection |
| placeholder | str | 'Select...' | text shown when nothing is selected |
| disabled | bool | False | disables the control; suppresses trigger variant tint |
| searchable | bool | False | adds search input to filter options |
| label | str | '' | optional label text |
| variant_map | Dict[str, str] | None | None | optional dict mapping option value → variant name; applied to any option that doesn't already declare its own ``variant`` key |
| **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 1144, 1146, 1149, 1151, 1152. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |