Skip to the content
Konstruktor UI

Navigation

Tabs

Panels of one subject shown one at a time, chosen by a row of tabs. <kui-tabs class="kui-tabs"> follows the WAI-ARIA tabs pattern over markup that already holds every panel. .kui-tablist is the same row made of links, for pages.

<kui-tabs> needs kui.js; the markup works without it as described below

Without JavaScript every panel shows, one after the other, and the tab row is hidden, so nothing is lost. Opening the page with a panel's id as the address fragment (#panel-id) selects that tab.

Examples

Tabs with counts and a disabled tab

Press Tab to reach the selected tab, then the arrow keys to move and select. Tab again moves into the panel.

Naknada štete zbog kašnjenja isporuke. Tužba podneta 3. marta 2026, Osnovni sud u Novom Sadu.

HTML
<kui-tabs class="kui-tabs">
  <div role="tablist" aria-label="Case Petrović">
    <button role="tab" aria-controls="tabs-p1" aria-selected="true">Overview</button>
    <button role="tab" aria-controls="tabs-p2">Documents <span class="kui-tab__count">14</span></button>
    <button role="tab" aria-controls="tabs-p3">Hearings <span class="kui-tab__count">3</span></button>
    <button role="tab" aria-controls="tabs-p4">Billing</button>
    <button role="tab" aria-controls="tabs-p5" disabled>Archive</button>
  </div>
  <div role="tabpanel" id="tabs-p1"><p>Naknada štete zbog kašnjenja isporuke. Tužba podneta 3. marta 2026, Osnovni sud u Novom Sadu.</p></div>
  <div role="tabpanel" id="tabs-p2" hidden><p>14 documents: the claim, two replies, eleven exhibits.</p></div>
  <div role="tabpanel" id="tabs-p3" hidden><p>Next hearing: 12 December 2026 at 10:30, room 14.</p></div>
  <div role="tabpanel" id="tabs-p4" hidden><p>Billed this year: 184 500,00 RSD.</p></div>
  <div role="tabpanel" id="tabs-p5" hidden><p>Nothing archived yet.</p></div>
</kui-tabs>

Manual activation

With activation="manual" the arrows only move focus and Enter or Space selects. Use it when a panel is slow to show, for example when it loads data.

November 2026: 38 invoices, 1 204 300 RSD.

HTML
<kui-tabs class="kui-tabs" activation="manual">
  <div role="tablist" aria-label="Report period">
    <button role="tab" aria-controls="tabs-m1" aria-selected="true">This month</button>
    <button role="tab" aria-controls="tabs-m2">Last quarter</button>
    <button role="tab" aria-controls="tabs-m3">2025</button>
  </div>
  <div role="tabpanel" id="tabs-m1"><p>November 2026: 38 invoices, 1 204 300 RSD.</p></div>
  <div role="tabpanel" id="tabs-m2" hidden><p>July to September 2026: 101 invoices, 3 410 900 RSD.</p></div>
  <div role="tabpanel" id="tabs-m3" hidden><p>2025: 402 invoices, 12 870 000 RSD.</p></div>
</kui-tabs>

Vertical tabs

With aria-orientation="vertical" on the tab list and .kui-tabs--vertical on the element, the tabs stand in a column beside the panel, and Up and Down move between them. Under 640 pixels they return to a row above the panel.

Name, email and the language of the interface.

HTML
<kui-tabs class="kui-tabs kui-tabs--vertical">
  <div role="tablist" aria-label="Settings" aria-orientation="vertical">
    <button role="tab" aria-controls="tabs-v1" aria-selected="true"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#user"></use></svg><span>Profile</span></button>
    <button role="tab" aria-controls="tabs-v2"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#bell"></use></svg><span>Notifications</span></button>
    <button role="tab" aria-controls="tabs-v3"><svg class="kui-icon" aria-hidden="true"><use href="kit/icons.svg#shield"></use></svg><span>Sicherheitseinstellungen</span></button>
  </div>
  <div role="tabpanel" id="tabs-v1"><p>Name, email and the language of the interface.</p></div>
  <div role="tabpanel" id="tabs-v2" hidden><p>Which reminders arrive by email and which only in the app.</p></div>
  <div role="tabpanel" id="tabs-v3" hidden><p>Password, two-step sign-in and the devices that are signed in.</p></div>
</kui-tabs>

A tab row of links

When each tab is its own page, use nav.kui-tablist with links and mark the current one with aria-current="page". It looks the same and is plain navigation, with no tab roles.

HTML
<nav class="kui-tablist" aria-label="Account">
  <a href="#tabs-l1" aria-current="page">Profile</a>
  <a href="#tabs-l2">Plan and billing</a>
  <a href="#tabs-l3">Team <span class="kui-tab__count">6</span></a>
  <a href="#tabs-l4">Integrations</a>
</nav>

States

Every state

Selected: strong text with a line under it. Hover darkens the name. Focus shows the ring inside the tab. Disabled is half strength and is skipped by the arrow keys. When the tabs do not fit, the row scrolls sideways without a scroll bar; the rest of the page does not.

The row scrolls when the tabs are wider than the screen.

HTML
<kui-tabs class="kui-tabs">
  <div role="tablist" aria-label="Many tabs">
    <button role="tab" aria-controls="tabs-s1" aria-selected="true">Selected</button>
    <button role="tab" aria-controls="tabs-s2">Default</button>
    <button role="tab" aria-controls="tabs-s3" disabled>Disabled</button>
    <button role="tab" aria-controls="tabs-s4">Januar</button>
    <button role="tab" aria-controls="tabs-s5">Februar</button>
    <button role="tab" aria-controls="tabs-s6">März</button>
    <button role="tab" aria-controls="tabs-s7">April</button>
    <button role="tab" aria-controls="tabs-s8">Mai</button>
  </div>
  <div role="tabpanel" id="tabs-s1"><p>The row scrolls when the tabs are wider than the screen.</p></div>
  <div role="tabpanel" id="tabs-s2" hidden><p>Default.</p></div>
  <div role="tabpanel" id="tabs-s3" hidden><p>Disabled.</p></div>
  <div role="tabpanel" id="tabs-s4" hidden><p>Januar.</p></div>
  <div role="tabpanel" id="tabs-s5" hidden><p>Februar.</p></div>
  <div role="tabpanel" id="tabs-s6" hidden><p>März.</p></div>
  <div role="tabpanel" id="tabs-s7" hidden><p>April.</p></div>
  <div role="tabpanel" id="tabs-s8" hidden><p>Mai.</p></div>
</kui-tabs>

Classes and attributes

kui-tabs.kui-tabs
The element. It wires the tabs to their panels and handles the keys.
[role="tablist"]
The row of tabs. Give it an aria-label; aria-orientation="vertical" for a column.
button[role="tab"]
One tab. aria-controls names its panel; aria-selected="true" on the one shown first; disabled to skip it.
[role="tabpanel"]
One panel, with the id the tab names. hidden on every panel but the first.
.kui-tab__count
A count after a tab’s name.
--vertical
Tabs in a column beside the panel, from 640 pixels up.
activation="manual"
The arrows move focus only; Enter or Space selects.
kui-change
Event when a tab is selected; detail.tab and detail.panel.
selected
Property: the id of the selected panel. Set it to select a tab from code.
nav.kui-tablist
A row of links that looks like tabs. aria-current="page" marks the current page.

Keyboard

Tab
Moves to the selected tab, then into the panel.
Arrow Right or Arrow Left
Moves to the next or previous tab and selects it; wraps at the ends.
Arrow Down or Arrow Up
The same, for vertical tabs.
Home or End
Moves to the first or the last tab.
Enter or Space
Selects the focused tab, with manual activation.

Accessibility

  • Follows the WAI-ARIA tabs pattern: one tab is in the tab order (roving tabindex), the arrows move between tabs.
  • Each panel is labelled by its tab (aria-labelledby, set by the element) and can be focused, so Tab moves into it even when it holds no control.
  • In right-to-left text Arrow Left and Arrow Right swap.
  • A row of links is nav.kui-tablist, not role="tablist": tab roles promise that a panel switches on the same page.
  • Without JavaScript the tab row is hidden and every panel shows, each still labelled by its content.

Do and do not

Do

  • Use tabs for views of one subject that a person does not need to see side by side.
  • Keep tab names to one or two words.
  • Show the first tab, or the one in the address, when the page opens.

Do not

  • Do not use tabs for steps that must happen in order; use the stepper.
  • Do not put two rows of tabs inside each other.
  • Do not hide a tab when it is empty; say so in its panel.