Skip to content

Navigation between multiple views with a tab bar.

atlas-tabs

Examples

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

InputTypeDefaultDescription
tabs requiredTabItem[]— The tabs: value , label , optional labelTemplate / contentTemplate (without it the panel shows the projected content); disabled tabs cannot be selected.
value two-waystring''value of the active tab, two-way. Bind it to start on a given tab.
ariaLabel string | nullnull Accessible name of the tab list, when nothing on screen names the group of tabs.
class string'' Extra CSS classes, merged with the component's own through cn() ; yours win on conflicts.

Types

TabItem

One tab. 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() })), );

PropertyTypeDescription
value string —
label string Tab text. Always set it: it is the fallback for labelTemplate .
disabled? boolean —
labelTemplate? TemplateRef<TabItemContext<T>> Rendered inside the tab instead of label (icons, counters).
contentTemplate? TemplateRef<TabItemContext<T>> Rendered in the tab's panel. Without it the panel shows the projected content.
data? T Payload for the templates ( tab.data ).

TabItemContext

Context of labelTemplate and contentTemplate .

PropertyTypeDescription
$implicit TabItem<T> —
selected boolean —