Input Group
Input group wrapper component (prefix/suffix addons).
Preview
$.00
Arguments
input_group(content='<span>$</span><input type="number" value="20"><span>.00</span>', size='md')
Usage
views.py
python
from djust import LiveView
from djust.components import InputGroup
from django.utils.safestring import mark_safe
class MyView(LiveView):
template_name = "my_template.html"
def mount(self, request, **kwargs):
self.component = InputGroup(content=mark_safe('<span>$</span><input type="number" value="20"><span>.00</span>'), size='md')my_template.html
django
{{ component }}Parameters
| Name | Type | Default |
|---|---|---|
| content | str | '' |
| size | str | 'md' |
| error | str | '' |
| custom_class | str | '' |
| **kwargs | — passed to `Component.__init__`: `name=` identifies the instance in the events it sends, `id=` sets `component.id`, and any other keyword is kept as state | — |
Source & styles
| File | Path | Notes |
|---|---|---|
| module | djust.components.components.input_group | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_theming/catalogue.css | Defines 1 of this component's classes at line 64. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |
| css | djust_theming/components.css | Defines 1 of this component's classes at line 263. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |
| css | djust_components/components.css | Defines 1 of this component's classes at line 971. Override those rules, or the custom properties they read, in a stylesheet loaded after it. |