Currency Input
Numeric input with currency symbol prefix and formatting hints.
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
| Name | Type | Default |
|---|---|---|
| name | str | '' |
| currency | str | 'USD' |
| value | str | '' |
| label | str | '' |
| min | float | None | None |
| max | float | None | None |
| step | str | '0.01' |
| placeholder | str | '0.00' |
| event | str — renames the event | '' |
| disabled | bool | False |
| required | bool | False |
| error | 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.currency_input | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 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. |