Tabs is a compound component: a host, a trigger directive, and an optional panel directive.

tabs.ts
import { KuiTabsComponent, KuiTabDirective, KuiTabPanelDirective } from '@kikita-labs/ui';

Bind value to the active tab and pair each kuiTab with a matching kuiTabPanel.

Overview content.
<kui-tabs [(value)]="activeTab">
  <button kuiTab value="overview">Overview</button>
  <button kuiTab value="settings">Settings</button>
  <button kuiTab value="logs">Logs</button>

  <div kuiTabPanel value="overview">Overview content.</div>
  <div kuiTabPanel value="settings">Settings content.</div>
  <div kuiTabPanel value="logs">Log content.</div>
</kui-tabs>

Set variant to pill for a soft background indicator. hasError adds a small danger dot to a tab without changing its selected state.

Daily report content.
<kui-tabs variant="pill" [(value)]="activeTab">
  <button kuiTab value="daily">Daily</button>
  <button kuiTab value="weekly" hasError errorLabel="Contains validation errors">Weekly</button>
  <button kuiTab value="monthly">Monthly</button>

  <div kuiTabPanel value="daily">Daily report content.</div>
  <div kuiTabPanel value="weekly">Weekly report content.</div>
  <div kuiTabPanel value="monthly">Monthly report content.</div>
</kui-tabs>

Set orientation to vertical to stack the tab list in a column. Add inverted when the panel should sit before the tab list and the indicator should move to the start edge.

Profile content.
<kui-tabs orientation="vertical" [(value)]="activeTab">
  <button kuiTab value="profile">Profile</button>
  <button kuiTab value="billing">Billing</button>
  <button kuiTab value="security">Security</button>

  <div kuiTabPanel value="profile">Profile content.</div>
  <div kuiTabPanel value="billing">Billing content.</div>
  <div kuiTabPanel value="security">Security content.</div>
</kui-tabs>

Set controlsPanels to false when tabs act as navigation and the routed content is rendered elsewhere, such as a router-outlet, instead of local kuiTabPanel elements.

<kui-tabs [(value)]="currentSection" [controlsPanels]="false" aria-label="Sections">
  <button kuiTab value="/overview">Overview</button>
  <button kuiTab value="/settings">Settings</button>
  <button kuiTab value="/team">Team</button>
</kui-tabs>

<p class="navigation-tabs-example__note">
  Selected value: <code>{{ currentSection() }}</code>
</p>

Inputs verified against @kikita-labs/ui v1.6.1 v1.6.1 public typings.

NameTypeDefaultDescription
variant'line' | 'pill''line'Tab visual style: underline indicator (line) or pill background (pill).
size'xs' | 'sm' | 'md' | 'lg''md'Tab trigger height and font size.
orientation'horizontal' | 'vertical''horizontal'Layout direction of the tab list. Vertical stacks triggers in a column with the indicator on the side edge.
invertedbooleanfalseFlips the tab edge. Horizontal tabs render panels above and the indicator on top; vertical tabs render panels before the list and the indicator on the start edge.
controlsPanelsbooleantrueWhether tabs expose aria-controls links to projected kuiTabPanel elements. Set to false when tabs are used as navigation and content is rendered elsewhere, such as a router-outlet.
[(value)]string-Value of the active tab.
[(selected)]string-Deprecated alias for value, kept in sync with it. Use value instead; planned for removal in the next major version.
[kuiTab] valuestring-Identifier for this tab trigger. Must match a kuiTabPanel value when controlsPanels is true.
[kuiTab] hasErrorbooleanfalseShows a small danger dot next to the tab label without changing the selected state or tab color.
[kuiTab] errorLabelstring''Screen-reader-only text announced alongside the error dot.
[kuiTabPanel] valuestring-Identifier matching a [kuiTab] value. Panel is shown when its value matches the tabs value.
--kui-tabs-gapCSS length2pxGap between tab triggers in the list.
--kui-tabs-borderCSS colorvar(--kui-color-border)Border color of the tab list edge (bottom for horizontal, side for vertical).
--kui-tabs-panel-gapCSS lengthvar(--kui-space-4)Gap between the tab list and the active panel.
--kui-tab-heightCSS lengthvar(--kui-btn-height)Tab trigger block size. Overridden per size.
--kui-tab-pxCSS lengthvar(--kui-btn-px)Tab trigger inline padding. Overridden per size.
--kui-tab-indicatorCSS colorvar(--kui-color-primary-fill)Color of the selected-tab indicator (underline for line, background for pill).
--kui-tab-fg-activeCSS colorvar(--kui-color-text)Text color of the selected tab.

Tabs owns keyboard navigation and the tablist/tab/tabpanel ARIA structure.

  • The list container uses role="tablist".
  • Each trigger uses role="tab" with aria-selected and roving tabindex.
  • Each panel uses role="tabpanel".
  • aria-controls is emitted by default and should point to a matching [kuiTabPanel]; disable this wiring with [controlsPanels]="false" for navigation-style tabs without local panels.
  • ArrowLeft / ArrowRight move focus between tabs.
  • Home focuses the first tab; End focuses the last tab.
  • At narrow widths the tablist scrolls horizontally and exposes accessible scroll buttons when needed.
  • Tabs covers keyboard navigation and static ARIA review. Screen reader and other assistive-technology verification has not been completed for this primitive yet; see state-coverage.md in the library repository for current review status.