Rich Select

Select dropdown where each option can include icons, images, descriptions,

python 10 params

Preview

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

NameTypeDefaultDescription
namestr''form field name
optionsList[Dict] | NoneNonelist of dicts with keys: value, label, and optional icon, image, description, badge, variant
valuestr''currently selected value
eventstr — renames the event''dj-click event name for selection
placeholderstr'Select...'text shown when nothing is selected
disabledboolFalsedisables the control; suppresses trigger variant tint
searchableboolFalseadds search input to filter options
labelstr''optional label text
variant_mapDict[str, str] | NoneNoneoptional 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
FilePathNotes
moduledjust.components.components.rich_selectSubclass it, or pass custom_class, to change how it renders.
cssdjust_components/components.cssDefines 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.