Time Picker

Style-agnostic time picker component using CSS custom properties.

python 11 params

Preview

:
Arguments
time_picker(name='start', value='09:30', label='Start time')

Usage

views.py
python
from djust import LiveView
from djust.components import TimePicker


class MyView(LiveView):
    template_name = "my_template.html"

    def mount(self, request, **kwargs):
        self.component = TimePicker(name='start', value='09:30', label='Start time')
my_template.html
django
{{ component }}

Parameters

NameTypeDefault
namestr'time'
valuestr''
eventstr — renames the event''
format_24hboolFalse
min_timestr''
max_timestr''
stepint1
disabledboolFalse
labelstr''
custom_classstr''
**kwargs— passed to `Component.__init__`: `id=` sets `component.id`, and any other keyword is kept as state
Source & styles
FilePathNotes
moduledjust.components.components.time_pickerSubclass it, or pass custom_class, to change how it renders.
cssdjust_components/components.cssDefines 7 of this component's classes at line 1778, 1779, 1780, 1781, 1782. Override those rules, or the custom properties they read, in a stylesheet loaded after it.