Time Picker
Style-agnostic time picker component using CSS custom properties.
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
| Name | Type | Default |
|---|---|---|
| name | str | 'time' |
| value | str | '' |
| event | str — renames the event | '' |
| format_24h | bool | False |
| min_time | str | '' |
| max_time | str | '' |
| step | int | 1 |
| disabled | bool | False |
| label | str | '' |
| custom_class | str | '' |
| **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.time_picker | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 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. |