Tabs
Keyboard-friendly tablist for switching between related sections.
- Selector
- ui-tabs
- Package
- @ngnova/ui/tabs
Import
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.
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.
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.
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.
| Name | Type | Default | Description |
|---|---|---|---|
id | string | generated | 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 | string | 'Tabs' | Accessible label for the tablist. |
orientation | 'horizontal' | 'vertical' | 'horizontal' | Tab layout and matching arrow-key navigation axis. |
variant | 'segmented' | 'underline' | 'pills' | 'segmented' | Visual treatment for the tablist without changing its interaction model. |
fullWidth | boolean | false | Stretches tab buttons across the available width. |
Outputs
activeChange OutputEmitterRef<string> Supports two-way binding for the active tab value.
| Name | Type | Description |
|---|---|---|
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.