Form Group

Form group wrapper component.

python 8 params

Preview

We never share it.
Arguments
form_group(label='Email', content='<input type="email" placeholder="you@example.com">', helper='We never share it.')

Usage

views.py
python
from djust import LiveView
from djust.components import FormGroup
from django.utils.safestring import mark_safe


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

    def mount(self, request, **kwargs):
        self.component = FormGroup(label='Email', content=mark_safe('<input type="email" placeholder="you@example.com">'), helper='We never share it.')
my_template.html
django
{{ component }}

Parameters

NameTypeDefault
contentstr''
labelstr''
errorstr''
helperstr''
requiredboolFalse
for_inputstr''
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.form_groupSubclass it, or pass custom_class, to change how it renders.
cssdjust_components/components.cssDefines 3 of this component's classes at line 500, 502, 504. Override those rules, or the custom properties they read, in a stylesheet loaded after it.
cssdjust_theming/components.cssDefines 2 of this component's classes at line 1045, 1378. Override those rules, or the custom properties they read, in a stylesheet loaded after it.
cssdjust_theming/scaffold.cssDefines 2 of this component's classes at line 437, 444. Override those rules, or the custom properties they read, in a stylesheet loaded after it.