Provide tabs with stable ids, labels and optional badges or disabled state. Project one neu-tab-panel with a matching tabId for every tab. activeId plus activeIdChange gives the application control; otherwise initialActiveId is a one-time seed and the component manages selection. null intentionally selects no panel. NeuTabLabel customizes the tab label, not the panel.
These inputs require a model or function, not a checkbox. Edit the same-named field in the Source component and bind it in the template; data already used by this preview appears in the state above.
initialActiveId ยท K | null
In Source: define initialActiveId with this type and use [initialActiveId]="initialActiveId" (or initialActiveId() for a signal).
activeIdChange proposes a tab key or null. In controlled mode, update activeId to accept the proposal. Do not switch between controlled and uncontrolled mode on the same instance.
Arrow Left/Right, Home and End move focus among enabled tabs. Enter or Space activates the focused tab; focus alone does not change selection. Give the tablist a meaningful ariaLabel. Narrow tab bars scroll horizontally.
Key
Action
Tab
Enter the tablist or reach controls in the active panel.
ArrowLeft / ArrowRight
Move focus between enabled tabs without changing selection.
Inputs and Outputs match the pinned Core package. Named types link to their definitions. Templates include executable examples for each supported region.
Inputs
Configure the component with [property]="value". Your application supplies these values; the component does not replace the state you pass in.
One-time selection seed when activeId is omitted; null falls back to the first enabled tab.
tabs
readonly T[]
[]
[tabs]
Tab definitions: unique id, label, optional badge and disabled flag.
Outputs
Listen to an event with (event)="handler($event)". The table explains the data your handler receives and how to use it.
Name
Payload
Template binding
Description
activeIdChange
K | null
(activeIdChange)="onActiveIdChange($event)"
Proposes the next active key or null; accept by updating activeId.
Templates
ng-content projects content into the component. TemplateRef inputs receive a template; ng-template directives identify templates with a typed context. A directive shared by an entrypoint is not necessarily a slot of this component.
Use let-tab and let-active="active" to customize the label; do not nest interactive controls inside the button.
ng-template[neuTabLabel]
Context used: $implicit: tab, active: boolean
template.d.ts
import type { NeuTab } from '@neural-ui/core/tabs';
import type { NeuTabKey } from '@neural-ui/core/tabs';
import { NeuTabLabelDirective } from '@neural-ui/core/tabs';
// Public declaration (reference only)
export declare class NeuTabLabelDirective<T extends NeuTab<NeuTabKey> = NeuTab<NeuTabKey>> {
}
context.d.ts
import type { NeuTabLabelContext } from '@neural-ui/core/tabs';
import { NeuTabLabelDirective } from '@neural-ui/core/tabs';
// Public declaration (reference only)
readonly templateRef: TemplateRef<NeuTabLabelContext<T>>;
Each example demonstrates a different template. Switch between Demo and Code to inspect its implementation, imports and state.
Content panels
*
Content panels
Review the order details before continuing.
Tab label
NeuTabLabelDirective
Tab label
Review the order details before continuing.
Public Types
Open a type to inspect its definition and interface fields.
NeuTab.d.ts
import type { NeuTabKey } from '@neural-ui/core/tabs';
import type { NeuTab } from '@neural-ui/core/tabs';
// Public declaration (reference only)
interface NeuTab<K extends NeuTabKey = string> {
readonly badge?: string;
readonly disabled?: boolean;
readonly id: K;
readonly label: string;
}
NeuTabKey.d.ts
import type { NeuTabKey } from '@neural-ui/core/tabs';
// Public declaration (reference only)
type NeuTabKey = string | number;
NeuTabLabelContext.d.ts
import type { NeuTab } from '@neural-ui/core/tabs';
import type { NeuTabKey } from '@neural-ui/core/tabs';
import type { NeuTabLabelContext } from '@neural-ui/core/tabs';
// Public declaration (reference only)
interface NeuTabLabelContext<T extends NeuTab<NeuTabKey> = NeuTab<NeuTabKey>> {
readonly $implicit: T;
readonly active: boolean;
}