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 |
|---|---|---|
| name | str | '' |
| value | int | 0 |
| min_val | int | None | None |
| max_val | int | None | None |
| step | int | 1 |
| event | str — renames the event | '' |
| 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.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 953, 954, 955, 958. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |