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

NameTypeDefault
namestr''
optionsList[Dict] | NoneNone
valuestr''
eventstr — renames the event''
placeholderstr'Select...'
disabledboolFalse
searchableboolFalse
labelstr''
variant_mapDict[str, str] | NoneNone
**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 1118, 1120, 1123, 1125, 1126. Override those rules, or the custom properties they read, in a stylesheet loaded after it.