Navigation

Tabs

@xui/tabs

Tabbed navigation. Arrow keys move between tabs (roving tabindex), Home/End jump to the ends, and disabled tabs are skipped. [(selectedTabId)] two-way binding; animate slides an indicator, orientation/fill/large adjust layout.

Install

pnpm add @xui/tabs

Add the barrel to a standalone component's imports:

import { XuiTabsImports } from '@xui/tabs';

@Component({
  imports: [XuiTabsImports],
  // …
})

Examples

Default

Loading preview…

Animated

Loading preview…

Fill

Loading preview…

Vertical

Loading preview…

API

XuiTabTitle

directive[xuiTabTitle]

Marks an <ng-template> inside a xui-tab as the tab's title, for when a plain title string is not enough (icons, tags, …).

XuiTab

componentxui-tab

A single tab. Its projected content is the panel body (rendered lazily via an <ng-template>); the tab strip label comes from the title input or a [xuiTabTitle] template.

Inputs

NameTypeDefaultidrequiredstringStable identifier used for selection and ARIA wiring.titlestringPlain-text tab-strip label (ignored when a [xuiTabTitle] template is given).''disabledbooleanMake the tab unselectable. It stays in the list, is skipped by the arrow keys, and is never chosen as the default selection.false

XuiTabs

componentxui-tabs

A tab set: a role="tablist" of titles over the panel of whichever xui-tab is selected.

Variants

AxisOptionsDefaultanimatedtruefalsefalselargetruefalsefalsefilltruefalsefalse

Inputs

NameTypeDefaultclassClassValueExtra classes, merged into the component's own rather than replacing them.''selectedTabIdtwo-waystring | nullThe active tab id. Two-way bindable with [(selectedTabId)].nullorientation'horizontal' | 'vertical'Run the tab list across the top (horizontal) or down the side (vertical). Also picks which arrow keys move the selection.this.config.orientationfillbooleanStretch the tabs to share the list's full width. Horizontal orientation only.falselargebooleanUse the roomier tab padding and base font size.this.config.largeanimatebooleanSlide an indicator bar under the active tab instead of a static underline.this.config.animaterenderActiveTabPanelOnlybooleanKeep only the active panel in the DOM (the others are not rendered).false

Source

libs/ui/tabs/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.