Übersicht FarbenTypografieAbstände & RasterIcons ButtonButton GroupIcon ButtonLink CheckboxCheckbox GroupChipChip GroupComboboxDate PickerFieldField LabelFieldsFile UploadFormForm SectionInputInput GroupOTP InputPasswordRadioRadio GroupRange SliderReset ButtonSave ButtonSearchSegmented ControlSelectSliderSwitchTextareaTime Picker AvatarAvatar GroupBadgeChartCode BlockCopy ValueData TableInline StatKey ValueList GroupList RowsMeta ItemQR CodeStatStat StripTableTag AlertEmpty StateGuideLive StatusMessagesProgressSkeletonToast DialogDrawerDropdownMenuMenu ItemPopoverTooltip BreadcrumbContent NavigationDate NavigationPaginationSidebarStepperTabsTheme SwitchTopbar AccordionAccordion ItemApp ShellCardDividerFooterPage HeaderSection HeaderSplit Panel DashboardListeFormularDetailansichtEinstellungenMehrschritt-AssistentLeerer StartLoginFehlerseite IconsMusterAdmin

Search

Zustände

Suchfeld leer mit Tastenkürzel, gefüllt mit Löschen-Button, deaktiviert und in Größe SM.

Code<div class="tc-stack" style="--tc-gap: 20px; max-width: 360px"> {% tc_search# placeholder="Hostname, IP oder Notiz suchen" %} {% tc_search# placeholder="Hostname, IP oder Notiz suchen" value="gateway" shortcut="" %} {% tc_search# placeholder="Hostname, IP oder Notiz suchen" disabled=True shortcut="" %} {% tc_search# placeholder="Filtern" size="sm" shortcut="" label="Tabelle filtern" show_label=True %} </div>

HTMX-Suche

die Anfrage startet 300 ms nach der letzten Eingabe und ersetzt die Ergebnisliste.

  • gateway-01.example.com · 10.0.4.17
  • gateway-02.example.com · 10.0.4.18
Code<div class="tc-stack" style="--tc-gap: 12px; max-width: 480px"> {% tc_search# name="q" placeholder="Geräte suchen" label="Geräte suchen" get_url="/beispiel/geraete/" target="search-results" swap="innerHTML" shortcut="" %} <ul id="search-results" class="tc-text-body tc-text-secondary" style="margin: 0; padding-left: 18px"> <li>gateway-01.example.com · 10.0.4.17</li> <li>gateway-02.example.com · 10.0.4.18</li> </ul> </div>

API

OptionStandardWerteBeschreibung
name'q'–Query parameter name.
value'None'–Current query.
label''–Accessible name; visible only with show_label (defaults to the placeholder).
show_labelFalse–Render the label above the field.
placeholder''–Placeholder, e.g. "Hostname, IP oder Notiz suchen".
shortcut'/'–Key that focuses the field (shown as keyboard hint); empty disables it.
disabledFalse–Disable the field.
size'md'Height: sm 28, md 36, lg 44 px (match the buttons in the same row).
help''–Hint below the control (Figma: Hint / Help Text).
error''–Error message or list of messages (e.g. Django field.errors); sets the error state, aria-invalid and aria-describedby. Replaces the hint while shown.
state''Validation state without an error message: success or warning colour the border and the hint.

Verwendung

{% load components tomcom_theme %} {% tc_search name="…" value="…" %}…{% endtc_search %} {% tc_search# %} {# inline form without content #}

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.