Formular
einspaltiges Muster mit Titel, Pflicht- und optionalen Feldern, Fehler am Feld und Aktionen unter einer Linie.
Formulare
Form frame (Figma: Pattern / Form): optional title, error summary for non-field errors, fields in one column (max. 560 px) or two columns on desktop (one on phones), and the action row below a rule. Without a body it renders all fields of form=. post/get shorthands submit via HTMX, htmx=True uses action; CSRF token and multipart encoding are added automatically.
einspaltiges Muster mit Titel, Pflicht- und optionalen Feldern, Fehler am Feld und Aktionen unter einer Linie.
Formularabschnitte wie Divider Type=Section, zwei Spalten ab 768 px, eine auf dem Telefon.
Hinweis oben (li slot="error"), Fehler an den Feldern, Absenden per hx-post und eigene Buttons.
die Steuerelemente sind formularassoziiert; die Vorschau zeigt die FormData statt abzusenden.
| Option | Standard | Werte | Beschreibung |
|---|---|---|---|
form | 'None' | – | Django form; renders all fields when the body is empty. |
method | 'post' | HTTP method without HTMX shorthands. | |
action | '' | – | Form action URL (also the HTMX target URL with htmx=True). |
htmx | False | – | Submit with HTMX (hx-post/hx-get to action). |
csrf | True | – | Insert the CSRF token for POST forms. |
multipart | False | – | Force multipart encoding (automatic for forms with file fields). |
novalidate | False | – | Disable browser validation (server errors are shown at the fields). |
columns | 1 | Field grid columns on desktop; two columns collapse below 768 px. | |
width | 'auto' | Max width: auto (560 px for one column), narrow (560 px) or full. | |
title | '' | – | Form heading (H2). |
hide_buttons | False | – | Omit the action row. |
save_label | '' | – | Label of the default save button. |
cancel_url | '' | – | Show an outlined cancel link next to the save button. |
cancel_label | '' | – | Label of the cancel link (default "Cancel"). |
reset | False | – | Add a reset button to the default actions. |
reset_label | '' | – | Label of the reset button (default "Reset"). |
{% slot buttons %} | – | Slot | Benannter Inhaltsbereich. |
Zusätzliche Attribute (z. B. class, aria-*, data-*) und HTMX-Kurzformen (get, post, get_url, post_url, target, swap, trigger, confirm) werden an das Element „root“ durchgereicht.