OTTODesign System

Components

Tab bar

The tab bar lets users switch between different pages or views that belong together.

Configurator

LiveTab bar: layout, icons, badge, divider and selection

Sneaker aus Glattleder mit gepolstertem Schaftrand und flexibler Gummisohle.

Obermaterial: Leder. Innenmaterial: Textil. Laufsohle: Gummi.

4,6 von 5 Sternen aus 128 Bewertungen.

HTML
<oc-tab-bar-v1><oc-tab-item-v1><button>Übersicht</button></oc-tab-item-v1><oc-tab-item-v1><button>Details</button></oc-tab-item-v1><oc-tab-item-v1><button>Bewertungen</button></oc-tab-item-v1><oc-tab-panel-v1 slot="panel"><p class="oc-copy-100" style="padding:16px 0">Sneaker aus Glattleder mit gepolstertem Schaftrand und flexibler Gummisohle.</p></oc-tab-panel-v1><oc-tab-panel-v1 slot="panel"><p class="oc-copy-100" style="padding:16px 0">Obermaterial: Leder. Innenmaterial: Textil. Laufsohle: Gummi.</p></oc-tab-panel-v1><oc-tab-panel-v1 slot="panel"><p class="oc-copy-100" style="padding:16px 0">4,6 von 5 Sternen aus 128 Bewertungen.</p></oc-tab-panel-v1></oc-tab-bar-v1>

Usage

Anatomy

Sneaker aus Glattleder mit gepolstertem Schaftrand und flexibler Gummisohle.

Obermaterial: Leder. Innenmaterial: Textil. Laufsohle: Gummi.

4,6 von 5 Sternen aus 128 Bewertungen.

Lieferung in 2 bis 4 Werktagen, ab 29 € versandkostenfrei.

123456
  1. Icon (optional)
  2. Label
  3. Badge (optional)
  4. Scroll button (when tabs overflow)
  5. Selected indicator
  6. Tab panel
LiveAnatomy
HTML
<div class="anatomy" style="display:block;max-width:360px;margin:40px auto 16px">
<oc-tab-bar-v1><oc-tab-item-v1><button><oc-icon-v1 type="list-view"></oc-icon-v1>Übersicht</button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="order"></oc-icon-v1>Details<oc-badge-v2 variant="primary" size="50"></oc-badge-v2></button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="rating-empty"></oc-icon-v1>Bewertungen</button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="delivery-flat"></oc-icon-v1>Lieferung</button></oc-tab-item-v1><oc-tab-panel-v1 slot="panel"><p class="oc-copy-100" style="padding:16px 0">Sneaker aus Glattleder mit gepolstertem Schaftrand und flexibler Gummisohle.</p></oc-tab-panel-v1><oc-tab-panel-v1 slot="panel"><p class="oc-copy-100" style="padding:16px 0">Obermaterial: Leder. Innenmaterial: Textil. Laufsohle: Gummi.</p></oc-tab-panel-v1><oc-tab-panel-v1 slot="panel"><p class="oc-copy-100" style="padding:16px 0">4,6 von 5 Sternen aus 128 Bewertungen.</p></oc-tab-panel-v1><oc-tab-panel-v1 slot="panel"><p class="oc-copy-100" style="padding:16px 0">Lieferung in 2 bis 4 Werktagen, ab 29 € versandkostenfrei.</p></oc-tab-panel-v1></oc-tab-bar-v1>
<span class="anatomy-pin" style="left:12%;top:-14%">1</span><span class="anatomy-pin" style="left:26%;top:-14%">2</span><span class="anatomy-pin" style="left:70%;top:-14%">3</span><span class="anatomy-pin" style="left:93%;top:-14%">4</span><span class="anatomy-pin" style="left:-3%;top:37%">5</span><span class="anatomy-pin" style="left:-3%;top:75%">6</span>
<ol class="anatomy-key"><li data-n="1">Icon (optional)</li><li data-n="2">Label</li><li data-n="3">Badge (optional)</li><li data-n="4">Scroll button (when tabs overflow)</li><li data-n="5">Selected indicator</li><li data-n="6">Tab panel</li></ol>

Variants

For the tab item there are following variants.

  • Default
  • Icon Left
  • Icon Top

All tab items in one tab bar must be the same. Different tab items cannot be mixed together.

Default

Icon left

Icon top

LiveDefault, icon left and icon top variants
HTML
<oc-tab-bar-v1><oc-tab-item-v1><button>Übersicht</button></oc-tab-item-v1><oc-tab-item-v1><button>Details</button></oc-tab-item-v1><oc-tab-item-v1><button>Bewertungen</button></oc-tab-item-v1></oc-tab-bar-v1>
<oc-tab-bar-v1><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Übersicht</button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Details</button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Bewertungen</button></oc-tab-item-v1></oc-tab-bar-v1>
<oc-tab-bar-v1 icon-position="top"><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Übersicht</button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Details</button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Bewertungen</button></oc-tab-item-v1></oc-tab-bar-v1>

Badges in sizes 50 or 100 can also be added to the tab items.

Icon left with badge 50 and 100

Icon top with badge 50 and 100

LiveTab items with badge
HTML
<p class="demo-label">Icon left with badge 50 and 100</p>
<oc-tab-bar-v1><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Postfach<oc-badge-v2 variant="primary" size="50"></oc-badge-v2></button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Konto</button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Hilfe</button></oc-tab-item-v1></oc-tab-bar-v1>
<oc-tab-bar-v1><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Postfach<oc-badge-v2 variant="primary">1</oc-badge-v2></button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Konto</button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Hilfe</button></oc-tab-item-v1></oc-tab-bar-v1>
<p class="demo-label">Icon top with badge 50 and 100</p>
<oc-tab-bar-v1 icon-position="top"><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Postfach<oc-badge-v2 variant="primary" size="50"></oc-badge-v2></button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Konto</button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Hilfe</button></oc-tab-item-v1></oc-tab-bar-v1>
<oc-tab-bar-v1 icon-position="top"><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Postfach<oc-badge-v2 variant="primary">1</oc-badge-v2></button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Konto</button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="smiley-positive"></oc-icon-v1>Hilfe</button></oc-tab-item-v1></oc-tab-bar-v1>

You can add a tab panel directly beneath the tab bar to hold your content.

Sneaker aus Glattleder mit gepolstertem Schaftrand und flexibler Gummisohle.

Obermaterial: Leder. Innenmaterial: Textil. Laufsohle: Gummi.

4,6 von 5 Sternen aus 128 Bewertungen.

LiveTab panel
HTML
<oc-tab-bar-v1><oc-tab-item-v1><button>Übersicht</button></oc-tab-item-v1><oc-tab-item-v1><button>Details</button></oc-tab-item-v1><oc-tab-item-v1><button>Bewertungen</button></oc-tab-item-v1><oc-tab-panel-v1 slot="panel"><p class="oc-copy-100">Sneaker aus Glattleder mit gepolstertem Schaftrand und flexibler Gummisohle.</p></oc-tab-panel-v1><oc-tab-panel-v1 slot="panel"><p class="oc-copy-100">Obermaterial: Leder. Innenmaterial: Textil. Laufsohle: Gummi.</p></oc-tab-panel-v1><oc-tab-panel-v1 slot="panel"><p class="oc-copy-100">4,6 von 5 Sternen aus 128 Bewertungen.</p></oc-tab-panel-v1></oc-tab-bar-v1>

Behavior

States

Selected and enabled (hover, press or focus a tab)

LiveStates
HTML
<oc-tab-bar-v1><oc-tab-item-v1><button>Übersicht</button></oc-tab-item-v1><oc-tab-item-v1><button>Details</button></oc-tab-item-v1><oc-tab-item-v1><button>Bewertungen</button></oc-tab-item-v1></oc-tab-bar-v1>

Placement

Always put the tab bar at the top of the content it controls.

Responsiveness

Breakpoint S (mobile):

By default, the tab items are fill-parent. If the label is too long, it will be abbreviated. If there are too many tab items to fit into the viewport, they will shrink to fit-content. The tab bar then becomes scrollable and the sides fade out to indicate that more tab items are available.

fill-parent: at breakpoint S (phone) long labels are abbreviated

fit-content: too many tabs, the bar scrolls and the sides fade

LiveResponsiveness mobile
HTML
<p class="demo-label">fill-parent: at breakpoint S (phone) long labels are abbreviated</p><div style="background:#fff;max-width:340px"><oc-tab-bar-v1><oc-tab-item-v1><button>Produktbeschreibung und Details</button></oc-tab-item-v1><oc-tab-item-v1><button>Bewertungen</button></oc-tab-item-v1></oc-tab-bar-v1></div></div>
<p class="demo-label">fit-content: too many tabs, the bar scrolls and the sides fade</p><div style="background:#fff;max-width:340px"><oc-tab-bar-v1><oc-tab-item-v1><button>Übersicht</button></oc-tab-item-v1><oc-tab-item-v1><button>Details</button></oc-tab-item-v1><oc-tab-item-v1><button>Bewertungen</button></oc-tab-item-v1><oc-tab-item-v1><button>Lieferung</button></oc-tab-item-v1><oc-tab-item-v1><button>Größen</button></oc-tab-item-v1><oc-tab-item-v1><button>Pflege</button></oc-tab-item-v1></oc-tab-bar-v1></div></div>
From breakpoint M (desktop):

Tab items are fit-contentby default. If there are too many tab items to fit into the viewport, the sides also fade. On desktop, icon buttons with arrows appear so you can click to scroll through the tab items.

fit-content from breakpoint M

Too many tabs: sides fade, arrow buttons scroll

LiveResponsiveness dektop
HTML
<div style="background:#fff;padding:0 16px 48px"><oc-tab-bar-v1><oc-tab-item-v1><button>Übersicht</button></oc-tab-item-v1><oc-tab-item-v1><button>Details</button></oc-tab-item-v1></oc-tab-bar-v1></div>
<div style="background:#fff;padding:0 16px 48px"><oc-tab-bar-v1><oc-tab-item-v1><button>Übersicht</button></oc-tab-item-v1><oc-tab-item-v1><button>Details</button></oc-tab-item-v1><oc-tab-item-v1><button>Bewertungen</button></oc-tab-item-v1><oc-tab-item-v1><button>Lieferung</button></oc-tab-item-v1><oc-tab-item-v1><button>Größen</button></oc-tab-item-v1><oc-tab-item-v1><button>Pflege</button></oc-tab-item-v1><oc-tab-item-v1><button>Material</button></oc-tab-item-v1><oc-tab-item-v1><button>Garantie</button></oc-tab-item-v1><oc-tab-item-v1><button>Zubehör</button></oc-tab-item-v1><oc-tab-item-v1><button>Fragen</button></oc-tab-item-v1><oc-tab-item-v1><button>Service</button></oc-tab-item-v1><oc-tab-item-v1><button>Rücksendung</button></oc-tab-item-v1><oc-tab-item-v1><button>Montage</button></oc-tab-item-v1><oc-tab-item-v1><button>Downloads</button></oc-tab-item-v1></oc-tab-bar-v1></div>

Animation

When you click on a new tab item, the selected indicator moves from the previously selected tab item to the newly selected one. If you select a tab item that is half-hidden off the screen, the tab bar automatically scrolls to put that tab item in the middle of the viewport. The content inside the tab panel slides smoothly in and out when you switch tab items.

Sneaker aus Glattleder mit gepolstertem Schaftrand und flexibler Gummisohle.

Obermaterial: Leder. Innenmaterial: Textil. Laufsohle: Gummi.

4,6 von 5 Sternen aus 128 Bewertungen.

Click a tab: the indicator moves and the panel slides in ↓

Sneaker aus Glattleder mit gepolstertem Schaftrand und flexibler Gummisohle.

Obermaterial: Leder. Innenmaterial: Textil. Laufsohle: Gummi.

4,6 von 5 Sternen aus 128 Bewertungen.

LiveAnimation
HTML
<div style="background:#fff;width:100%;max-width:400px"><oc-tab-bar-v1><oc-tab-item-v1><button>Übersicht</button></oc-tab-item-v1><oc-tab-item-v1><button>Details</button></oc-tab-item-v1><oc-tab-item-v1><button>Bewertungen</button></oc-tab-item-v1><oc-tab-panel-v1 slot="panel"><p class="oc-copy-100" style="padding:16px 0">Sneaker aus Glattleder mit gepolstertem Schaftrand und flexibler Gummisohle.</p></oc-tab-panel-v1><oc-tab-panel-v1 slot="panel"><p class="oc-copy-100" style="padding:16px 0">Obermaterial: Leder. Innenmaterial: Textil. Laufsohle: Gummi.</p></oc-tab-panel-v1><oc-tab-panel-v1 slot="panel"><p class="oc-copy-100" style="padding:16px 0">4,6 von 5 Sternen aus 128 Bewertungen.</p></oc-tab-panel-v1></oc-tab-bar-v1></div>
<p class="demo-label" style="text-align:center">Click a tab: the indicator moves and the panel slides in ↓</p>
<div style="background:#fff;width:100%;max-width:400px"><oc-tab-bar-v1 selected="1"><oc-tab-item-v1><button>Übersicht</button></oc-tab-item-v1><oc-tab-item-v1><button>Details</button></oc-tab-item-v1><oc-tab-item-v1><button>Bewertungen</button></oc-tab-item-v1><oc-tab-panel-v1 slot="panel"><p class="oc-copy-100" style="padding:16px 0">Sneaker aus Glattleder mit gepolstertem Schaftrand und flexibler Gummisohle.</p></oc-tab-panel-v1><oc-tab-panel-v1 slot="panel"><p class="oc-copy-100" style="padding:16px 0">Obermaterial: Leder. Innenmaterial: Textil. Laufsohle: Gummi.</p></oc-tab-panel-v1><oc-tab-panel-v1 slot="panel"><p class="oc-copy-100" style="padding:16px 0">4,6 von 5 Sternen aus 128 Bewertungen.</p></oc-tab-panel-v1></oc-tab-bar-v1></div>

Tab bar vs. chips

The tab bar is used for navigation. Clicking a tab item changes the content of a page or the panel below it. Only one tab item can be selected at a time. Chips are used for filtering. Selecting a chip filters or changes content on the same page (like picking colors or sizes). You can select none, one, or multiple chips at the same time.

Do

Meine Rechnungen

LiveDo
HTML
<oc-tab-bar-v1 icon-position="top"><oc-tab-item-v1><button><oc-icon-v1 type="person"></oc-icon-v1>Mein Konto</button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="order"></oc-icon-v1>Bestellungen</button></oc-tab-item-v1><oc-tab-item-v1><button><oc-icon-v1 type="order-payment"></oc-icon-v1>Rechnungen</button></oc-tab-item-v1></oc-tab-bar-v1>
<p class="demo-title">Meine Rechnungen</p>
<oc-tab-bar-v1><oc-tab-item-v1><button>Offen</button></oc-tab-item-v1><oc-tab-item-v1><button>Alle</button></oc-tab-item-v1></oc-tab-bar-v1>

Do

Sortieren nach

Farbe

LiveDo
HTML
<p class="demo-title">Sortieren nach</p><div class="demo-row gap-8" style="flex-wrap:nowrap;overflow:hidden"><oc-chip-v3><input type="radio" name="tb-sort" checked aria-label="oc-auto"><label slot="content">Topseller</label></oc-chip-v3><oc-chip-v3><input type="radio" name="tb-sort" aria-label="oc-auto"><label slot="content">Niedrigster Preis</label></oc-chip-v3><oc-chip-v3><input type="radio" name="tb-sort" aria-label="oc-auto"><label slot="content">Höchster Preis</label></oc-chip-v3><oc-chip-v3><input type="radio" name="tb-sort" aria-label="oc-auto"><label slot="content">Neuheiten</label></oc-chip-v3></div></div>
<p class="demo-title">Farbe</p><div class="demo-row gap-8"><oc-chip-v3><input type="checkbox" checked aria-label="oc-auto"><img slot="image" src="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%2712%27 fill=%27%232b6cd6%27/%3E%3C/svg%3E" alt=""><label slot="content">Blau</label></oc-chip-v3><oc-chip-v3><input type="checkbox" aria-label="oc-auto"><img slot="image" src="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%2712%27 fill=%27%23000000%27/%3E%3C/svg%3E" alt=""><label slot="content">Schwarz</label></oc-chip-v3><oc-chip-v3><input type="checkbox" checked aria-label="oc-auto"><img slot="image" src="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%2712%27 fill=%27%23cccccc%27/%3E%3C/svg%3E" alt=""><label slot="content">Grau</label></oc-chip-v3><oc-chip-v3><input type="checkbox" aria-label="oc-auto"><img slot="image" src="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%2712%27 fill=%27%23a8e03a%27/%3E%3C/svg%3E" alt=""><label slot="content">Grün</label></oc-chip-v3><oc-chip-v3><input type="checkbox" aria-label="oc-auto"><img slot="image" src="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%2712%27 fill=%27%23ffd970%27/%3E%3C/svg%3E" alt=""><label slot="content">Gelb</label></oc-chip-v3><oc-chip-v3><input type="checkbox" aria-label="oc-auto"><img slot="image" src="data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 24 24%27%3E%3Ccircle cx=%2712%27 cy=%2712%27 r=%2712%27 fill=%27%23e95f80%27/%3E%3C/svg%3E" alt=""><label slot="content">Rot</label></oc-chip-v3></div></div>

Content guidelines

DoKeep the labels short so they do not get abbreviated on mobile.
DoUse the same type of words for all tab items (e.g. all nouns).

Accessibility

To learn how to use the tab bar with a keyboard (like using the arrow keys) or to see code tags like role="tab", please check the technical documentation.

Implementation

Live demo

Mein Konto

Meine Bestellungen

Kommt morgen, Mi., 01.10.Bestellt am 26.09.2026Wird gerade verpacktBestellt am 27.09.2026
Zugestellt am 16.09.Bestellt am 12.09.2026Zugestellt am 04.09.Bestellt am 02.09.2026

Du hast gerade keine offenen Rücksendungen.

Artikel zurückschicken
LiveReal OTTO components, rendered by the OTTO component runtime
HTML
<div class="on-frame" style="padding:32px 16px">
<div style="width:100%;max-width:390px;margin:0 auto;background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 1px 3px rgba(0,0,0,.08)">
<div style="padding:20px 16px 0"><p class="oc-copy-75" style="color:var(--oc-semantic-color-text-secondary)" style="margin:0">Mein Konto</p><p class="oc-headline-200" style="margin:0">Meine Bestellungen</p></div>
<oc-tab-bar-v1 show-divider><oc-tab-item-v1><button>Unterwegs<oc-badge-v2 variant="primary">2</oc-badge-v2></button></oc-tab-item-v1><oc-tab-item-v1><button>Geliefert</button></oc-tab-item-v1><oc-tab-item-v1><button>Retouren</button></oc-tab-item-v1>
  <oc-tab-panel-v1 slot="panel"><div style="padding:0 16px 16px"><oc-row-v2 variant="image" icon-right="arrow-right" hide-divider><img slot="image" src="/previews/imagery/samples/otto-product-still/product-headphones.webp" alt="" width="64" height="64" style="max-width:100%"><a href="#" aria-label="Bestellung vom 26.09.2026 ansehen"></a><span style="display:grid"><span class="oc-copy-100" style="font-weight:700">Kommt morgen, Mi., 01.10.</span><span class="oc-copy-75" style="color:var(--oc-semantic-color-text-secondary)">Bestellt am 26.09.2026</span></span></oc-row-v2><oc-row-v2 variant="image" icon-right="arrow-right"><img slot="image" src="/previews/imagery/samples/otto-product-still/product-sneaker.webp" alt="" width="64" height="64" style="max-width:100%"><a href="#" aria-label="Bestellung vom 27.09.2026 ansehen"></a><span style="display:grid"><span class="oc-copy-100" style="font-weight:700">Wird gerade verpackt</span><span class="oc-copy-75" style="color:var(--oc-semantic-color-text-secondary)">Bestellt am 27.09.2026</span></span></oc-row-v2></div></oc-tab-panel-v1>
  <oc-tab-panel-v1 slot="panel"><div style="padding:0 16px 16px"><oc-row-v2 variant="image" icon-right="arrow-right" hide-divider><img slot="image" src="/previews/imagery/samples/otto-product-still/product-armchair.webp" alt="" width="64" height="64" style="max-width:100%"><a href="#" aria-label="Bestellung vom 12.09.2026 ansehen"></a><span style="display:grid"><span class="oc-copy-100" style="font-weight:700">Zugestellt am 16.09.</span><span class="oc-copy-75" style="color:var(--oc-semantic-color-text-secondary)">Bestellt am 12.09.2026</span></span></oc-row-v2><oc-row-v2 variant="image" icon-right="arrow-right"><img slot="image" src="/previews/references/images/otto/otto-fashion-drop-mojo-06.webp" alt="" width="64" height="64" style="max-width:100%"><a href="#" aria-label="Bestellung vom 02.09.2026 ansehen"></a><span style="display:grid"><span class="oc-copy-100" style="font-weight:700">Zugestellt am 04.09.</span><span class="oc-copy-75" style="color:var(--oc-semantic-color-text-secondary)">Bestellt am 02.09.2026</span></span></oc-row-v2></div></oc-tab-panel-v1>
  <oc-tab-panel-v1 slot="panel"><div style="padding:16px"><p class="oc-copy-100" style="margin:0 0 12px">Du hast gerade keine offenen Rücksendungen.</p><oc-button-v1 variant="secondary" icon-type-left="order-return">Artikel zurückschicken</oc-button-v1></div></oc-tab-panel-v1>
</oc-tab-bar-v1>

Code

Version Tag Status API
v1 <oc-tab-bar-v1> Stable TabBarV1

API

API: <oc-tab-bar-v1> (TabBarV1)

The Tab Bar component provides an accessible tab navigation pattern following W3C standards. It orchestrates tab items and optional panels with keyboard navigation and proper ARIA attributes.

Architecture: The parent oc-tab-bar-v1 uses shadow DOM and manages all state and ARIA attributes. The child components (oc-tab-item-v1 and oc-tab-panel-v1) are lightweight wrappers without shadow DOM for optimal performance.

Attributes / properties
Attribute Type Default Required Description
variant "default" | "centered" "default" no Specifies which layout variant to use. Can be one of: default, centered.
icon-position "left" | "top" "left" no Controls the icon position for all tab items. - "left": Icons appear to the left of labels (default) - "top": Icons appear above labels

Important: This setting applies to all tab items in the tab bar. Mixing different icon positions is not supported for visual consistency.
show-divider boolean false no When set to true, shows the divider line below the tab bar.
selected number undefined (first enabled tab) no The index of the initially selected tab (0-based).

Important: This prop only sets the initial state when the component mounts. It is not reactive and will not update the selection if changed later.

For programmatic tab selection after mount, use the select(index) method instead: javascript document.querySelector('oc-tab-bar-v1').select(2);

If not provided, the first enabled tab will be selected. If the specified index is disabled, the first enabled tab will be selected instead.
Slots
Slot Required Description
default yes Contains oc-tab-item-v1 and oc-tab-panel-v1 elements. Tab items should come first, followed by panels (if used). The order determines the tab-to-panel association.
Events
Event Detail type Description
oc-tab-change CustomEvent<{ index: number; tabId: string; }> Fired when a tab is selected. Detail contains the selected tab index.
oc-property-change OcTabBarV1Events["oc-property-change"] Whenever a property value changes, this event triggers. Use this event to track all property changes within the component.

Refer to the Events documentation for more information.
oc-mount { component: string; } Fired when the component is mounted to the DOM. The event is fired when the onMount hook of the component is called by the runtime.
oc-unmount { component: string; } Fired when the component is unmounted from the DOM. The event is fired when the function returned by the onMount hook of the component is called by the runtime.
Methods
  • select: (index: number) => void

    Programmatically select a tab by its index.

    Parameters:

    • index: number - The 0-based index of the tab to select

    Returns: void

    Example:

    const tabBar = document.querySelector('oc-tab-bar-v1');
    tabBar.select(2); // Select the third tab
    

Examples

Listed below are the most common variations of the tab bar component as well as specific component variations for different use cases.

Default

The default tab bar with many tabs. At mobile sizes (< 448px), tabs use fill-parent mode (expand equally). At desktop sizes (≥ 448px), tabs use fit-content mode and become scrollable with fade indicators.

HTML
<oc-tab-bar-v1>
<oc-tab-item-v1>
          <button>Tab 1</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 2</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 3</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 4</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 5</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 6</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 7</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 8</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 9</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 10</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 11</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 12</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 13</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 14</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 15</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 16</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 17</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 18</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 19</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 20</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 21</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 22</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 23</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 24</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 25</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 26</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 27</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 28</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 29</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 30</button>
        </oc-tab-item-v1>
</oc-tab-bar-v1>
Centered with divider

A centered tab bar with fewer tabs. Tabs are centered within the tab bar container. A divider is also displayed below the tabs.

HTML
<oc-tab-bar-v1 variant="centered" show-divider>
<oc-tab-item-v1>
          <button>Tab 1</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 2</button>
        </oc-tab-item-v1>
        <oc-tab-item-v1>
          <button>Tab 3</button>
        </oc-tab-item-v1>
</oc-tab-bar-v1>
With Panels

Tab bar with three tabs and associated content panels. Each tab item is linked to a corresponding panel that displays relevant content. When a tab is selected, its panel becomes visible while others are hidden. The order of tab items and panels determines their association (first tab to first panel, etc.).

Panel 1

This is the content for the first tab.

Panel 2

This is the content for the second tab.

Panel 3

This is the content for the third tab.

HTML
<oc-tab-bar-v1>
<oc-tab-item-v1>
  <button>Overview</button>
</oc-tab-item-v1>
<oc-tab-item-v1>
  <button>Details</button>
</oc-tab-item-v1>
<oc-tab-item-v1>
  <button>Reviews</button>
</oc-tab-item-v1>
<oc-tab-panel-v1 slot="panel">
  <div class="oc-p-100">
    <h3 class="oc-headline-100 oc-mb-50">Panel 1</h3>
    <p class="oc-copy-100">This is the content for the first tab.</p>
</oc-tab-panel-v1>
<oc-tab-panel-v1 slot="panel">
  <div class="oc-p-100">
    <h3 class="oc-headline-100 oc-mb-50">Panel 2</h3>
    <p class="oc-copy-100">This is the content for the second tab.</p>
</oc-tab-panel-v1>
<oc-tab-panel-v1 slot="panel">
  <div class="oc-p-100">
    <h3 class="oc-headline-100 oc-mb-50">Panel 3</h3>
    <p class="oc-copy-100">This is the content for the third tab.</p>
</oc-tab-panel-v1>
</oc-tab-bar-v1>
Without Panels

Tab bar without content panels. In this configuration, tabs serve purely as navigation elements without displaying additional content. Useful when content is managed elsewhere in the application or when tabs navigate to different pages.

HTML
<oc-tab-bar-v1>
<oc-tab-item-v1>
  <button>Home</button>
</oc-tab-item-v1>
<oc-tab-item-v1>
  <button>Products</button>
</oc-tab-item-v1>
<oc-tab-item-v1>
  <button>About</button>
</oc-tab-item-v1>
</oc-tab-bar-v1>
Mixed - With and Without Panels

Tab bar with and without panels.

Privacy Policy

Panel 1

This is the content for the first tab.

Panel 2

This is the content for the second tab.

Panel 3

This is the content for the third tab.

HTML
<oc-tab-bar-v1>
<oc-tab-item-v1>
  <button>Home</button>
</oc-tab-item-v1>
<oc-tab-item-v1>
  <button>Products</button>
</oc-tab-item-v1>
<oc-tab-item-v1>
  <button>About</button>
</oc-tab-item-v1>
<oc-tab-item-v1>
  <a href="#">Privacy Policy</a>
</oc-tab-item-v1>
<oc-tab-panel-v1 slot="panel">
  <div class="oc-p-100">
    <h3 class="oc-headline-100 oc-mb-50">Panel 1</h3>
    <p class="oc-copy-100">This is the content for the first tab.</p>
</oc-tab-panel-v1>
<oc-tab-panel-v1 slot="panel">
  <div class="oc-p-100">
    <h3 class="oc-headline-100 oc-mb-50">Panel 2</h3>
    <p class="oc-copy-100">This is the content for the second tab.</p>
</oc-tab-panel-v1>
<oc-tab-panel-v1 slot="panel">
  <div class="oc-p-100">
    <h3 class="oc-headline-100 oc-mb-50">Panel 3</h3>
    <p class="oc-copy-100">This is the content for the third tab.</p>
</oc-tab-panel-v1>
</oc-tab-bar-v1>
Initial Selection

Demonstrates setting the initial selected tab using the selected prop. The second tab (index 1) is selected on mount.

Panel 1

First panel content.

Panel 2

Second panel content (shown initially).

Panel 3

Third panel content.

HTML
<oc-tab-bar-v1 selected="1">
<oc-tab-item-v1>
  <button>Tab 1</button>
</oc-tab-item-v1>
<oc-tab-item-v1>
  <button>Tab 2 (Initially Selected)</button>
</oc-tab-item-v1>
<oc-tab-item-v1>
  <button>Tab 3</button>
</oc-tab-item-v1>
<oc-tab-panel-v1 slot="panel">
  <div class="oc-p-100">
    <h3 class="oc-headline-100 oc-mb-50">Panel 1</h3>
    <p class="oc-copy-100">First panel content.</p>
</oc-tab-panel-v1>
<oc-tab-panel-v1 slot="panel">
  <div class="oc-p-100">
    <h3 class="oc-headline-100 oc-mb-50">Panel 2</h3>
    <p class="oc-copy-100">Second panel content (shown initially).</p>
</oc-tab-panel-v1>
<oc-tab-panel-v1 slot="panel">
  <div class="oc-p-100">
    <h3 class="oc-headline-100 oc-mb-50">Panel 3</h3>
    <p class="oc-copy-100">Third panel content.</p>
</oc-tab-panel-v1>
</oc-tab-bar-v1>