API REFERENCE · NAVIGATION
<dj-tab-container>
Tabbed interface. tabs describes the buttons; the panels are slotted children in the same order (one per tab). The active panel is shown, the rest hidden. ARIA tablist/tab/tabpanel with roving arrow/Home/End keyboard; arrows, Home and End skip disabled tabs. Delete closes a closeable tab (the tab advertises it with aria-keyshortcuts); its close icon is for the pointer only, so no button sits inside a tab. If active-index points at no tab or a disabled one, the first enabled tab keeps the Tab-key stop. Each tab controls its panel (aria-controls, where the browser supports element references) and each panel is labelled with its tab's name unless it has its own label. Inactive panels stay hidden even when page CSS sets their display. Local coordination of slotted panels — no store needed.
npm install @dojo-ng/tab-container
import "@dojo-ng/tab-container";
Properties
| Property | Attribute | Type | Default |
|---|---|---|---|
tabs |
tabs |
TabItem[] |
[] |
activeIndex |
active-index reflected |
number |
0 |
alignButtons |
align-buttons reflected |
"top""bottom""left""right" |
"top" |
Events
| Event | Description |
|---|---|
change | detail: active index |
dj-tab-close | detail: index |
Slots
Default slot
CSS parts
Style these with dj-tab-container::part(name).
tablisttabpanels
Types
The types that the properties above use, as they are declared in the source.
TabItem
export interface TabItem { name: string; disabled?: boolean; closeable?: boolean; }