Ü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

Topbar

Varianten

Sidebar-Layout mit Menü-Button, Testumgebung mit Badge, horizontale Navigation.

Code<div class="tc-stack"> {% tc_topbar# product="Plattformname" user_name="Max Mustermann" notifications=3 help_url="#" %} {% tc_topbar# product="Plattformname" environment="Test" user_name="Max Mustermann" notifications=0 %} {% tc_topbar product="Plattformname" navigation="horizontal" user_name="Max Mustermann" help_url="#" %} {% slot nav %}{% tc_topbar_item# label="Übersicht" active=True %}{% tc_topbar_item# label="Einträge" %}{% tc_topbar_item# label="Verlauf" %}{% tc_topbar_item# label="Einstellungen" %}{% endslot %} {% endtc_topbar %} </div>

Benutzermenü und Aktionen

eigener Inhalt im user_menu-Slot (natives Popover), zusätzliche Aktionen im actions-Slot.

Erika Musterfrauerika@example.comProfilAbmelden
Code{% tc_topbar product="Plattformname" show_search=False user_name="Erika Musterfrau" %} {% slot actions %}<a href="#" aria-label="Dokumentation" title="Dokumentation">{% tc_svg 'book' %}</a>{% endslot %} {% slot user_menu %}<div class="tc-stack" style="--tc-gap:4px;padding:8px"><strong>Erika Musterfrau</strong><span class="tc-text-body-sm tc-text-secondary">erika@example.com</span><a href="#">Profil</a>{% tc_theme_switch# variant="menu" %}<a href="#">Abmelden</a></div>{% endslot %} {% endtc_topbar %}

HTML und JS-API

<tc-topbar> mit <tc-topbar-item>-Links; Suche und Theme-Switch entstehen automatisch, openSearch() und tc-menu.

Übersicht
Suche öffnen
Code<div class="tc-stack" style="--tc-gap: 12px"> <tc-topbar id="raw-topbar" product="Plattformname" environment="Test" notifications="2" user-name="Max Mustermann" search-placeholder="Einträge suchen …" menu-label="Navigation öffnen"> <tc-topbar-item slot="nav" active><a href="#">Übersicht</a></tc-topbar-item> <tc-topbar-item slot="nav" href="#" label="Einträge"></tc-topbar-item> <a slot="actions" href="#" aria-label="Dokumentation" title="Dokumentation"><tc-icon name="book"></tc-icon></a> </tc-topbar> <div class="tc-cluster"> <tc-button id="raw-topbar-search" variant="outlined" size="sm" icon="search">Suche öffnen</tc-button> <span id="raw-topbar-log" class="tc-text-body-sm tc-text-secondary" aria-live="polite"></span> </div> </div> <script> (function () { var topbar = document.getElementById('raw-topbar'); var log = document.getElementById('raw-topbar-log'); document.getElementById('raw-topbar-search').addEventListener('click', function () { topbar.openSearch(); }); topbar.addEventListener('tc-menu', function (event) { log.textContent = 'tc-menu: open=' + event.detail.open; }); topbar.addEventListener('tc-input', function (event) { log.textContent = 'tc-input: ' + event.detail.value; }); })(); </script>

API

OptionStandardWerteBeschreibung
product''–Platform name next to the logo.
product_href'/'–Link of logo and product name.
show_companyTrue–Show the tomcom logo.
environment''–Environment badge such as "Test"; empty hides it (production).
navigation'sidebar'Shows the menu button for a sidebar layout.
show_searchTrue–Show the search field (replace it with the search slot).
search_url''–GET action of the search form.
search_name'q'–Query parameter name.
search_value''–Current query.
search_placeholder''–Placeholder; defaults to "Search …".
help_url''–Shows a help icon link.
notifications'None'–Unread count; shows a bell (0 shows the bell without badge).
notifications_url''–Link of the bell.
show_themeTrue–Show the light/dark/auto switch.
user_name''–Signed-in user; shows avatar and name.
user_initials''–Avatar initials; derived from the name by default.
{% slot nav %}–SlotBenannter Inhaltsbereich.
{% slot search %}–SlotBenannter Inhaltsbereich.
{% slot actions %}–SlotBenannter Inhaltsbereich.
{% slot user_menu %}–SlotBenannter Inhaltsbereich.

Topbar Search

OptionStandardWerteBeschreibung
name'q'–Query parameter name.
value''–Current query.
placeholder''–Placeholder; defaults to "Search …".
label''–Accessible name; defaults to "Search".

Topbar Item

OptionStandardWerteBeschreibung
href'#'–Target URL.
label''–Text when the slot is empty.
activeFalse–Current page (aria-current).

Verwendung

{% load components tomcom_theme %} {% tc_topbar product="…" product_href="…" %}…{% endtc_topbar %} {% tc_topbar# %} {# 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.