Number Stepper

Numeric +/- stepper input component.

python 9 params

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

NameTypeDefaultDescription
namestr''form field name
valueint0current value
min_valint | NoneNoneminimum value
max_valint | NoneNonemaximum value
stepint1increment amount
eventstr — renames the event''dj-click event name
labelstr''label text
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.number_stepperSubclass it, or pass custom_class, to change how it renders.
cssdjust_components/components.cssDefines 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.