ARIA Tabs
The ARIA Tabs provides an accessible tabbed interface for organizing content into layered sections following WAI-ARIA patterns.Installation
Components
Tabs
The main container for a tabbed interface. Selector:[ngTabs]
Source: /home/daytona/workspace/source/src/aria/tabs/tabs.ts:46
TabList
Container for tab headers. Selector:[ngTabList]
Inputs
selectedTab(model) - The currently selected tab value. Use two-way binding with[(selectedTab)]orientation(‘horizontal’ | ‘vertical’) - Tab list orientationdisabled(boolean) - Whether the tab list is disabled
Tab
An individual tab header. Selector:[ngTab]
Inputs
value(required) - Unique identifier for this tabdisabled(boolean) - Whether this tab is disabled
TabPanel
Content panel associated with a tab. Selector:[ngTabPanel]
Inputs
value(required) - Value matching the corresponding tabpreserveContent(boolean) - Whether to preserve content when panel is hidden
TabContent
Directive for lazy-loaded tab content. Selector:[ngTabContent]
Basic Usage
Vertical Tabs
Dynamic Tabs
Disabled Tabs
Keyboard Navigation
Horizontal Tabs
- Arrow Left/Right - Navigate between tabs
- Home - Focus first tab
- End - Focus last tab
- Tab - Move focus to active tab panel
Vertical Tabs
- Arrow Up/Down - Navigate between tabs
- Home - Focus first tab
- End - Focus last tab
- Tab - Move focus to active tab panel
Accessibility Features
- Implements ARIA tabs pattern
- Proper roles:
tablist,tab,tabpanel aria-selectedfor active tabaria-controlslinking tabs to panelsaria-labelledbylinking panels to tabsaria-orientationfor layout direction- Focus management
- Full keyboard navigation
- Screen reader announcements
- Hidden panels use
inertattribute
Lazy Loading
By default, tab panel content is lazy-loaded using thengTabContent directive. Content is only rendered when the tab is first activated: