Varianten
Segmented Control mit zwei, drei und vier Segmenten sowie mit Icons.
Formulare
Switch between two to four mutually exclusive views or modes, e.g. list/board or light/dark/auto (Figma: Segmented Control). Form-associated <tc-segmented-control> with light <button> segments (role="radio"): Tab focuses the selection, arrow keys move it. Listen to change/tc-change and read .value; with get/post HTMX requests fire on change.
Segmented Control mit zwei, drei und vier Segmenten sowie mit Icons.
sichtbares Gruppenlabel und gleich breite Segmente.
Segmente sind button-Kinder; change/tc-change melden den neuen Wert.
value: list
| Option | Standard | Werte | Beschreibung |
|---|---|---|---|
name | '' | – | Form field name. |
options | '()' | – | Segments: dictionaries (value, label, icon, disabled), Django choices or "value=Label|value=Label". |
value | 'None' | – | Selected value (defaults to the first segment). |
label | '' | – | Group label; hidden unless show_label is set (always announced). |
show_label | False | – | Show the label above the control. |
disabled | False | – | Disable all segments. |
block | False | – | Stretch to the container width with equal segments. |
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.