Tabs
Data Displayatlas-tabsExamples
Basic
Tabs are data: give each tab its panel through contentTemplate .
Custom label and panel
Set labelTemplate / contentTemplate on a tab to render your own markup; label stays the text fallback. Templates get the tab ( let-tab , with your payload in tab.data ) and whether it is selected ( let-selected="selected" ), so one template can serve every tab.
Disabled tabs and outside control
[(value)] keeps the active tab in your state, so other controls can switch it. A disabled tab stays visible but cannot be chosen.
API
Generated from the library source, so it always matches the code.
AtlasTabsComponent atlas-tabs
| Input | Type | Default | Description |
|---|---|---|---|
| tabs required | TabItem[] | — | value , label , optional labelTemplate / contentTemplate (without it the panel shows the projected content); disabled tabs cannot be selected. |
| value two-way | string | '' | value of the active tab, two-way. Bind it to start on a given tab. |
| ariaLabel | string | null | null | |
| class | string | '' | cn() ; yours win on conflicts. |
Types
TabItem
value is the control's value ( [(value)] ), so it keeps that name (Book ch.05, "Item keys"). Templates are per tab and get the tab ( let-tab , your payload in tab.data ) and whether it is selected ( let-selected="selected" ), so one template can serve every tab: ts private readonly panel = viewChild.required<TemplateRef<TabItemContext<Report>>>('panel'); readonly tabs = computed<TabItem<Report>[]>(() => this.reports.map((r) => ({ value: r.id, label: r.name, data: r, contentTemplate: this.panel() })), );
| Property | Type | Description |
|---|---|---|
| value | string | |
| label | string | labelTemplate . |
| disabled? | boolean | |
| labelTemplate? | TemplateRef<TabItemContext<T>> | label (icons, counters). |
| contentTemplate? | TemplateRef<TabItemContext<T>> | |
| data? | T | tab.data ). |
TabItemContext
labelTemplate and contentTemplate .
| Property | Type | Description |
|---|---|---|
| $implicit | TabItem<T> | |
| selected | boolean |