Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
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
| Input | Type | Default | Description |
|---|---|---|---|
id | string | undefined | generated | Unique identifier used to create IDs for the tabs parts. |
ids | Partial<TabsElementIds> | undefined | — | Overrides generated identifiers for individual parts. |
value | string | null | undefined | — | Selected tab value when controlled. Supports Angular two-way binding. |
defaultValue | string | null | undefined | null | Initially 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. |
loopFocus | boolean | undefined | true | Wraps keyboard focus from the last trigger to the first and vice versa. |
composite | boolean | undefined | true | Enables composite keyboard navigation among tab triggers. |
deselectable | boolean | undefined | false | Allows the selected tab to be deselected. |
lazyMount | boolean | false | Mounts tab content only after it is first selected. |
unmountOnExit | boolean | false | Removes tab content from the DOM when it is not selected. |
navigate | ((details: TabsNavigateDetails) => void) | null | undefined | — | Handles navigation when a trigger represents a link. |
translations | TabsIntlTranslations | undefined | — | Overrides accessible text used by the tabs. |
Use [(value)]="value" for two-way binding, or pair [value] with (valueChange) when using
signals.
Outputs
| Output | Type | Description |
|---|---|---|
valueChange | string | null | undefined | Emits the updated controlled selected value. |
focusChange | TabsFocusChangeDetails | Emits when the focused tab trigger changes. |
valueDetailsChange | TabsValueChangeDetails | Emits details whenever the selected tab value changes. |
navigateChange | TabsNavigateDetails | Emits navigation details when a linked trigger is used. |
[appTabsList]
| Input | Type | Default | Description |
|---|---|---|---|
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>
| Input | Type | Default | Description |
|---|---|---|---|
value | string | required | Unique value that identifies the tab. |
disabled | boolean | false | Prevents 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]
| Input | Type | Default | Description |
|---|---|---|---|
value | string | required | Associates the panel with its matching trigger. |
Context, Providers, and Utilities
| Export | Angular API |
|---|---|
TabsRootProvider | Directive [tabs-root-provider] providing an externally created tabs API. |
TabsContext | Structural 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. |
TabsImports | Readonly collection containing the Angular tabs UI and context helpers. |
Types
| Export | Description |
|---|---|
TabsApi | Connected tabs state and actions. |
TabsElementIds | Overrides for generated tabs part IDs. |
TabsFocusChangeDetails | Details emitted by focusChange. |
TabsIntlTranslations | Accessible text overrides for the tabs. |
TabsNavigateDetails | Details emitted by navigateChange. |
TabsValueChangeDetails | Details emitted by valueDetailsChange. |
Angular
React
Solid
Svelte
Vue