Component v1.1.0 Navigation/Data

Tabs

Keyboard-friendly tablist for switching between related sections.

API Stable 2.1 WCAG notes Ready Dark mode
Selector
ui-tabs
Package
@ngnova/ui/tabs

Import

Standalone Tailwind v4
import { UiTabsComponent } from '@ngnova/ui/tabs';

Usage & variants

Live examples use the public ui-tabs API, paired with the exact snippet a product team would paste into an Angular app.

API Reference

Component reference tabs

Keyboard-friendly tablist for switching between related sections.

Segmented

Overview panel content stays associated with the selected tab.

Underline

Overview panel content stays associated with the selected tab.

Pills

Overview panel content stays associated with the selected tab.

Production guidance

Use these notes to decide when the component belongs in a product workflow and what to verify before shipping.

When to use

Use when sections are peers and users frequently move between them.

Watch for

Disabled tabs are skipped during keyboard navigation.

Product recipes

Apply Tabs in distinct, copyable product scenarios—not just an isolated component state.

Controlled tabs

Parent state owns the active value.

Angular template ui-tabs-recipe.example.html
1
2
3
<ui-tabs [tabs]="tabs" [active]="activeTab" (activeChange)="activeTab = $event">
  @if (activeTab === 'overview') { Overview }
</ui-tabs>

Visual variants

Choose segmented for general navigation, underline for content sections, or pills for compact filters.

Angular template ui-tabs-recipe.example.html
1
2
3
4
5
6
7
8
9
10
11
<ui-tabs variant="segmented" [tabs]="tabs" [(active)]="activeTab">
  Segmented panel
</ui-tabs>

<ui-tabs variant="underline" [tabs]="tabs" [(active)]="activeTab">
  Underline panel
</ui-tabs>

<ui-tabs variant="pills" [tabs]="tabs" [(active)]="activeTab">
  Pills panel
</ui-tabs>

API Reference

Inputs and outputs are semver-sensitive public API. Keep examples aligned with this table.

Inputs

id generated
string

Base ID used for tab and panel ARIA relationships.

tabs []
readonly UiTabItem[]

Tab labels, values, and disabled states.

active ''
string

Currently selected tab value.

ariaLabel 'Tabs'
string

Accessible label for the tablist.

orientation 'horizontal'
'horizontal' | 'vertical'

Tab layout and matching arrow-key navigation axis.

variant 'segmented'
'segmented' | 'underline' | 'pills'

Visual treatment for the tablist without changing its interaction model.

fullWidth false
boolean

Stretches tab buttons across the available width.

Outputs

activeChange OutputEmitterRef<string>

Supports two-way binding for the active tab value.

Accessibility

  • Uses tablist, tab, and tabpanel roles with generated ARIA relationships.
  • Exactly one enabled tab participates in the roving tab stop, including when active is empty or invalid.

Keyboard behavior

  • ArrowLeft and ArrowRight move between enabled horizontal tabs; ArrowUp and ArrowDown do the same for vertical tabs.
  • Home and End jump to first and last tabs.
  • Keyboard navigation moves focus and activates the destination tab automatically.

Testing guidance

  • Assert keyboard navigation, disabled tabs, activeChange, and ARIA IDs.