Atomic Angular — Doc interne

Navbar Tabs

A tab bar generated from the Angular Router's own child-route configuration, with automatic overflow into a dropdown and optional per-tab result counts.

<navbar-tabs> renders one tab per child route of a given router path — there is no tab list to pass in, only a data object per route. The active tab tracks the current URL, and whatever doesn't fit collapses into a "⋮" menu instead of clipping.

Minimal example

Renders nothing when path has no matching child routes in the router config.

How it works

read by tabs / currentPath / searchText renders one Tab per entry, overflowItem count last item, overflowStop opens lists selectedTabChange MenuItem click path changed? NavigationEnd Router config children of path injectRouteNavigation NavbarTabsComponent TabList OverflowManagerDirective visibleTabCount signal moreTabs computed ellipsis more button Menu moreTabsMenu onSelectTab navigateToTab Router navigate

Selection is a two-way model (selectedTab) kept in sync with currentPath() one-way only — an effect pushes currentPath() into selectedTab, never the reverse — so a click (which updates selectedTab before the URL actually changes) is not immediately overwritten by that same effect.

Where the counts and the persisted-filters behavior come from

text, tab routerConfig result tabs, per-tab count tabs with count general features persistFiltersAcrossTabs merge vs replace router navigate NavigationEnd QueryParamsStore injectRouteNavigation ApplicationService QueryService NavbarTabsComponent AppStore persistFiltersAcrossTabs computed getQueryParamsHandling Router

A tab shows no badge at all (not a 0 badge) unless its queryName matches the current result's query name; it is disabled only once the matched count is exactly 0 — in the visible bar and in the overflow menu alike.

Options

Prop

Type

No outputs — tab activation navigates through the Angular Router directly.

Pitfalls

What's next

On this page