Search documentation

Search the documentation and open a page.

A set of layered sections of content that display one panel at a time.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/tabs

Composition

<app-tabs> ├── [appTabsList] │ ├── <button appTabsTrigger> │ │ ├── [appTabsTriggerDescription] (optional) │ │ └── [appTabsTriggerCount] (optional) │ └── [appTabsIndicator] (optional) └── [appTabsContent]

Examples

Default

Loading...

Disabled

Loading...

Full Width

Loading...

Line

Loading...

Metric Tabs

Loading...

Secondary

Loading...

Sizes

Loading...

Stacked

Loading...

Vertical

Loading...

With Counts

Loading...

With Icons

Loading...

API Reference

<app-tabs>

Inputs

InputTypeDefaultDescription
idstring | undefinedgeneratedUnique identifier used to create IDs for the tabs parts.
idsPartial<TabsElementIds> | undefined—Overrides generated identifiers for individual parts.
valuestring | null | undefined—Selected tab value when controlled. Supports Angular two-way binding.
defaultValuestring | null | undefinednullInitially selected tab value when uncontrolled.
orientation"horizontal" | "vertical" | undefined"horizontal"Sets the tabs orientation and keyboard navigation axis.
activationMode"manual" | "automatic" | undefined"automatic"Selects a tab automatically on focus or only after explicit activation.
loopFocusboolean | undefinedtrueWraps keyboard focus from the last trigger to the first and vice versa.
compositeboolean | undefinedtrueEnables composite keyboard navigation among tab triggers.
deselectableboolean | undefinedfalseAllows the selected tab to be deselected.
lazyMountbooleanfalseMounts tab content only after it is first selected.
unmountOnExitbooleanfalseRemoves tab content from the DOM when it is not selected.
navigate((details: TabsNavigateDetails) => void) | null | undefined—Handles navigation when a trigger represents a link.
translationsTabsIntlTranslations | undefined—Overrides accessible text used by the tabs.

Outputs

OutputTypeDescription
valueChangestring | null | undefinedEmits the updated controlled selected value.
focusChangeTabsFocusChangeDetailsEmits when the focused tab trigger changes.
valueDetailsChangeTabsValueChangeDetailsEmits details whenever the selected tab value changes.
navigateChangeTabsNavigateDetailsEmits navigation details when a linked trigger is used.

[appTabsList]

InputTypeDefaultDescription
variant"default" | "line" | "primary" | "secondary""default"Sets the visual style of the trigger list.
size"default" | "lg""default"Sets the size of the trigger list.

<button appTabsTrigger>

InputTypeDefaultDescription
valuestringrequiredUnique value that identifies the tab.
disabledbooleanfalsePrevents the tab trigger from being activated.
align"start" | "center""start"Aligns content within the tab trigger.
layout"inline" | "stacked""inline"Arranges trigger content inline or in a stack.

[appTabsContent]

InputTypeDefaultDescription
valuestringrequiredAssociates the panel with its matching trigger.

Context, Providers, and Utilities

ExportAngular API
TabsRootProviderDirective [tabs-root-provider] providing an externally created tabs API.
TabsContextStructural directive [tabs-context] exposing the root API to a template.
useTabs(options)Creates the signal-backed tabs machine inside an Angular injection context.
injectTabsContext()Injects the nearest tabs root context.
injectTabsContextCarrier()Injects the context carrier used to preserve the tabs context.
injectTabsRenderStrategyContext()Injects the content mounting strategy.
TabsImportsReadonly collection containing the Angular tabs UI and context helpers.

Types

ExportDescription
TabsApiConnected tabs state and actions.
TabsElementIdsOverrides for generated tabs part IDs.
TabsFocusChangeDetailsDetails emitted by focusChange.
TabsIntlTranslationsAccessible text overrides for the tabs.
TabsNavigateDetailsDetails emitted by navigateChange.
TabsValueChangeDetailsDetails emitted by valueDetailsChange.