Zur Navigation Zum Inhalt Kontakt Menu Komponente finden Übersicht Lyne Prinzipien Grundlagen Barrierefreiheit Design System Guidelines Deutsch Français Italiano English Unsere Gestaltungsprinzipien Nutzerzentriert Wiedererkennbar Inklusiv Reduziert Ganzheitlich Selbsterklärend Aufgabenorientiert Passend SBB Markenportal Logo Digitale Uhr Nutzungsrechte Basis-Farben Funktionale Farben Off-Brand Farben Icons Fahrplan-Icons Piktogramme Über Barrierefreiheit Über diesen Guide Kontakt Weitere Informationen Product Owner User Research Interaction Design Visual Design Development Content Design Testing Was ist ein Design System?​ Designing Coding FAQ Hilfe Prozess Contribution Kontakt Übersicht Basis Komponenten Übersicht Basis Komponenten Übersicht Basis Komponenten Übersicht Releases Design Tokens Komponenten Übersicht Basis Informationen Sinn & Zweck Community Assets Anleitung Power-Apps Digitale Werbebanner SAP App Icons Tab-Group Implementation

The sbb-tab-group is a component used to organize and gather tabs that the user can navigate through;
use it when you want to provide navigation within blocks of content, instead of showing everything in one place
or requiring the user to navigate between several different views.

Each tab has a related content, distinct from other tabs' content;
tab panels can present different sections of content and include text, images, forms, other tab groups, etc.

<sbb-tab-group>
  <sbb-tab-title>I am the first</sbb-tab-title>
  <div>Tab content 1</div>

  <sbb-tab-title>I am the second</sbb-tab-title>
  <section>Tab content 2</section>

  <sbb-tab-title>I am the third</sbb-tab-title>
  <article>Tab content 3</article>
</sbb-tab-group>

In order to display a tab label within the tab bar, provide a sbb-tab-title right before its related tab content;
please refer to the sbb-tab-title documentation for more details.

Note: the content element should be wrapped in a div, a section or an article and placed right after its relative sbb-tab-title.
Tab groups can also be nested, which means that a tab's content block can be represented by another sbb-tab-group,
as shown in the "Nested Tab Groups" example.

States

A tab can be selected, unselected, or in disabled state; disable a tab to mark it as unavailable.
Disabled tabs cannot be focused and may be invisible to assistive technologies such as screen readers.

It's possible to set the first selected tab using the initialSelectedIndex property.

<sbb-tab-group initial-selected-index="1"> ... </sbb-tab-group>

Properties

Name Attribute Privacy Type Default Description
size size public InterfaceSbbTabGroupTab['size'] 'l' Size variant, either l or xl.
initialSelectedIndex initial-selected-index public number 0 Sets the initial tab. If it matches a disabled tab or exceeds the length of the tab group, the first enabled tab will be selected.

Methods

Name Privacy Description Parameters Return Inherited From
disableTab public Disables a tab by index. tabIndex: number void
enableTab public Enables a tab by index. tabIndex: number void
activateTab public Activates a tab by index. tabIndex: number void

Events

Name Type Description Inherited From
didChange CustomEvent<void> Emits an event on selected tab change

Slots

Name Description
Use the unnamed slot to add html-content to the sbb-tab-group. Wrap the content in a div, a section, an article or provide a nested sbb-tab-group: This is correct: <div>Some text <p>Some other text</p></div> This is not correct: <span>Some text</span><p>Some other text</p>
tab-bar When you provide the sbb-tab-title tag through the unnamed slot, it will be automatically moved to this slot. You do not need to use it directly.
Beispiele
Default Tabs Size L
Numbers And Icons Size L
Default Tabs Size XL
Numbers And Icons Size XL
Nested Tab Groups
Tinted Background
HTML-Markup kopiert.
Komponente finden

Lyne

Impressum Kontakt Cookie Einstellungen