Currency Input

Numeric input with currency symbol prefix and formatting hints.

python 14 params

Preview

$USD

Usage

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


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

    def mount(self, request, **kwargs):
        self.component = CurrencyInput()
my_template.html
django
{{ component }}

Parameters

NameTypeDefault
namestr''
currencystr'USD'
valuestr''
labelstr''
minfloat | NoneNone
maxfloat | NoneNone
stepstr'0.01'
placeholderstr'0.00'
eventstr — renames the event''
disabledboolFalse
requiredboolFalse
errorstr''
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.currency_inputSubclass it, or pass custom_class, to change how it renders.
cssdjust_components/components.cssDefines 5 of this component's classes at line 1427, 1428, 1430, 1431, 1435. Override those rules, or the custom properties they read, in a stylesheet loaded after it.