Input Group

Input group wrapper component (prefix/suffix addons).

python 5 params

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

NameTypeDefault
contentstr''
sizestr'md'
errorstr''
custom_classstr''
**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
FilePathNotes
moduledjust.components.components.input_groupSubclass it, or pass custom_class, to change how it renders.
cssdjust_theming/catalogue.cssDefines 1 of this component's classes at line 64. Override those rules, or the custom properties they read, in a stylesheet loaded after it.
cssdjust_theming/components.cssDefines 1 of this component's classes at line 263. Override those rules, or the custom properties they read, in a stylesheet loaded after it.
cssdjust_components/components.cssDefines 1 of this component's classes at line 971. Override those rules, or the custom properties they read, in a stylesheet loaded after it.