Form Group
Form group wrapper component.
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
| Name | Type | Default |
|---|---|---|
| content | str | '' |
| label | str | '' |
| error | str | '' |
| helper | str | '' |
| required | bool | False |
| for_input | 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.form_group | Subclass it, or pass custom_class, to change how it renders. |
| css | djust_components/components.css | Defines 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. |
| css | djust_theming/components.css | Defines 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. |
| css | djust_theming/scaffold.css | Defines 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. |