Number Stepper
Numeric +/- stepper input component.
Preview
Usage
views.py
python
from djust import LiveView
from djust.components import NumberStepper
class MyView(LiveView):
template_name = "my_template.html"
def mount(self, request, **kwargs):
self.component = NumberStepper()my_template.html
django
{{ component }}Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| name | str | '' | form field name |
| value | int | 0 | current value |
| min_val | int | None | None | minimum value |
| max_val | int | None | None | maximum value |
| step | int | 1 | increment amount |
| event | str — renames the event | '' | dj-click event name |
| label | str | '' | label text |
| 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.number_stepper | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 4 of this component's classes at line 979, 980, 981, 984. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |