Angular Navigationsmenü-Komponente | ng-hub-ui-nav
Angular Navigationskomponente mit Dropdowns, Drill-down-Panels, responsivem Einklappen, Router-Integration und Theming über CSS-Variablen.
Zuletzt aktualisiert 19.08.2026
Übersicht
Warum Teams nach dieser Bibliothek suchen
Greife zu dieser Angular Navigationskomponente, wenn du horizontale, vertikale oder Drill-down-Menüs mit Router-Bewusstsein und wiederverwendbaren UX-Mustern benötigst.
Installieren
npm install ng-hub-ui-navSpringen zu
Ideal für
- App-Shells
- Admin-Dashboards
- Dokumentationsmenüs
- responsive Navigation
Über nav
ng-hub-ui-nav ist nützlich, wenn Angular-Anwendungen einem einfachen oberen Menü entwachsen. Es deckt vertikale Sidebars, Dropdown-Bäume, verschachtelte Navigation und responsive Einklapp-Muster ab, wie sie in Dokumentationsseiten, Dashboards und Enterprise-Shells vorkommen.
Funktionsleitfäden
Dropdown-Verschachtelung
Unbegrenzte mehrstufige Dropdown-Menüs mit Klick-, Hover- oder kombinierten Trigger-Modi. Enthält Trennzeichen- und Header-Elemente.
Beispiele:
Verschachtelte mehrstufige Dropdowns
Verschachtelte mehrstufige Dropdowns
Kopfzeilen & Trennlinien
Kopfzeilen & Trennlinien
Dropdown-Auslöser
Dropdown-Auslöser
Zustände
Demonstriert deaktivierte Root- und verschachtelte Elemente sowie deren Interaktionsverhalten.
Beispiele:
Deaktivierte Zustände
Deaktivierte Zustände
Gekürzte Labels & Tooltip
Gekürzte Labels & Tooltip
Narrow sidebar — hover a clipped item to read its full label.
Responsives Verhalten
Responsives Einklappen, mobiles Rendering und RTL-Slot-Verhalten.
Beispiele:
Responsive Einklappmodi
Responsive Einklappmodi
Offcanvas mode
Click the toggler to open the mobile panel.
Dropdown mode
Click the toggler to open the mobile panel.
Fullscreen mode
Click the toggler to open the mobile panel.
RTL mit Start-/End-Slots
RTL mit Start-/End-Slots
Desktop-Icon-Leiste
Klappt die vertikale Navigation zu einer reinen Icon-Leiste ein, die jeden Bereich einen Klick entfernt hält: Beschriftungen erscheinen als Tooltips, Gruppen öffnen sich als Overlay-Flyouts, und die App besitzt den Umschalter und die Persistenz über die bidirektionale rail-Bindung.
Beispiele:
Eingeklappte Icon-Leiste
Eingeklappte Icon-Leiste
Content area — the built-in toggle on the sidebar edge collapses the nav into an icon rail, returning horizontal space to data-dense screens. Hover a rail item to see its label; click a group to open its flyout.
Slots & Templates
Start-/End-Slot-Projektion und benutzerdefinierte Element-Templates zum Erstellen maßgeschneiderter Navigations-UIs.
Beispiele:
Start- & End-Slots
Start- & End-Slots
Benutzerdefinierte Elementvorlage
Benutzerdefinierte Elementvorlage
Router-Integration
Router-Links, Query-Parameter, Fragmente und Active-State-Matching über routerLinkActive-Optionen.
Beispiele:
Router-Integration & aktive Zustände
Router-Integration & aktive Zustände
This example uses real router links. Items pointing to /nav and /nav/api can show active state while browsing nav documentation tabs.
Travel needs a real navigation to travel between, so the live instance is the sidebar of this very page: click two library entries and watch the mark move. It is deliberately reserved for a choice — a scroll spy reports position by replacing the URL rather than pushing one, and following that stepped this documentation's own menu through twenty highlight changes in six seconds of ordinary reading. That is what followReplacedUrls governs: true follows every report, a number of milliseconds follows only once they go quiet (this site uses 400), and false never follows.
Events
Beobachten Sie Interaktionsereignisse für Links, Dropdowns, mobile Toggles und Panel-Navigation.
Beispiele:
Ereignis-API
Ereignis-API
Last event:
{
"name": "none",
"payload": null
}Panel-Drill-Down
Gestapelte Panel-Navigation, bei der das Klicken auf ein Dropdown dessen untergeordnete Elemente in einem Seitenpanel öffnet. Unterstützt konfigurierbare maximale Panel-Anzahl, Drill-Down mit Zurück-Navigation und links-/rechtsseitige Sidebar-Positionierung.
Beispiele:
Panel-Drilldown-Navigation
Panel-Drilldown-Navigation
expandMode-Überschreibung pro Element
expandMode-Überschreibung pro Element
Rechter Seitenleisten-Panel-Modus
Rechter Seitenleisten-Panel-Modus
Main content area — the sidebar is placed on the right and panels extend to the left.
Hauptfunktionen
Letzte Änderungen
Version 22.10.0 - 8/16/26, 12:00 AM
fixed: The scroll spy could never reach the last sections of a page: its observation band stops partway down the viewport, so once the container has nothing left to scroll, everything below that line was unreachable — clicking the final entry of a seven-example page settled the mark four items above it. The last section now wins outright at the end of the container. Selection also went by intersectionRatio, which measures how much of a section fits the band rather than which comes first, so a short block beat the tall one the reader was in the middle of; the topmost section wins now.
added: config.followReplacedUrls sets how eagerly the nav follows a scroll spy, which names the section under the reader by replacing the URL: true follows each report (the previous behaviour and the default), a number of milliseconds follows only once the reports go quiet so a scroll lands the mark once, and false never follows. On a thirty-item panel that turns twenty highlight changes in six seconds of reading into one. Alongside it, the active mark can travel between items instead of appearing and disappearing in place (config.activeIndicator, off by default). One element per list, parked over whichever sibling is active and moved with a transform, so the animation never touches the layout; duration and easing come from the new --hub-nav-item-active-indicator-transition. Opt-in because the mark is normally painted by each item, so turning it on moves the same pixels to a node the list owns. Travelling says you chose to go here, and most moves are not that: the mark travels for a pushed navigation and arrives for a replaced one, which is how a scroll spy reports position — otherwise it flies up and down a long panel while the reader is only reading. A relayout is treated the same way. Travel only means something between siblings: crossing into a submenu, a drill-down panel or a collapsed rail swaps one list for another, so each list owns its mark and it fades in there. Geometry is measured and re-measured through a ResizeObserver, since the rail, the accordion and the viewport all resize items without the list hearing about it. Honours prefers-reduced-motion.
Version 22.9.1 - 8/16/26, 12:00 AM
fixed: An item stopped being marked active when the application serialized URLs with a trailing slash. /products and /products/ are the same place, and a canonical trailing-slash UrlSerializer is an ordinary SEO choice, but route matching compared the two as raw strings — so every item declared without the slash silently stopped matching, and only its ancestors stayed lit because their prefix test tolerates one. Worst on items differing from their siblings only by fragment: none ever matched, so a scroll-spy panel appeared dead. Paths are now compared normalized, root excluded.
Version 22.9.0 - 8/15/26, 12:00 AM
added: Desktop icon rail: the new two-way rail input collapses a vertical nav to --hub-nav-rail-width showing icons only. A built-in edge toggle (config.railToggle, default true, fully themeable through the --hub-nav-rail-toggle-* tokens including a replaceable SVG arrow) flips the state; labels surface as tooltips, accordion groups open as click-triggered overlay flyouts, and below collapseBreakpoint the offcanvas behavior always wins. The library persists nothing — railChange lets the host store the preference.
added: Localizable built-in labels: the previously hardcoded ARIA strings (Toggle navigation, Close navigation, Go back, Close panel, Toggle {label}) now resolve from HUBUI.NAV.* keys via the shared translation adapter, with per-instance overrides through config.labels.
Version 22.8.4 - 8/13/26, 12:00 AM
fixed: Route-aware panel sidebars now choose the most specific active root item when opening panels. A localized Home route such as /en/ no longer wins over /en/forms/overview/, so deep links keep the active library secondary panel open instead of leaving only its root entry highlighted.
Version 22.8.3 - 8/8/26, 12:00 AM
fixed: Documentation links now point at the canonical localized URLs. The README linked to https://hubui.dev/<path> with no locale prefix and no trailing slash, and both forms are 301-redirected, so every reader arriving from npm or GitHub landed on a redirect instead of the canonical page.
Version 22.8.2 - 8/7/26, 12:00 AM
fixed: A section no longer blinks when you click inside it. Clicking an entry closed every dropdown — right for a flyout, which is transient and dismissed by the click — but an accordion opened from the route states where you are, so closing it and letting the route reopen it a tick later made the section shut and open again on every navigation. The click now leaves the dropdown state alone when the route owns it (autoOpenFromRoute on an accordion) and still dismisses a flyout.
Version 22.8.1 - 8/7/26, 12:00 AM
fixed: An accordion opens the section you navigated into. Opening from the route was decided by whether the rail was collapsed and nothing else, so a vertical accordion arrived at /products with its section shut, while the panel it opened instead sat behind the page, invisible to the eye and the pointer. The expanded rail now consults the effective expand mode of the section holding the active route, so an accordion syncs its dropdowns and only a flyout or panel rail opens panels.
fixed: Two entries no longer claim to be where you are. Marking a section on everything below it also marked an entry whose route prefixes a sibling's: at /products/categories, both "Products" (/products) and "Categories" lit up. The longest matching route among siblings wins now, so the catalogue is marked there and the list is still marked at /products/42/edit. An exact match is never overridden, and a dropdown that matched through a child keeps its mark.
Version 22.8.0 - 8/6/26, 12:00 AM
fixed: The rail keeps its mark on a detail page. An item was active only on its exact route, so opening a record — /customers/42/edit from /customers — cleared the mark. An item is now active on its own route and on anything below it, matched by whole segments (/products is not marked by /products-archive), with the query string ignored. A root item (/) still matches only itself, and routerLinkActiveOptions: { exact: true } — declared but never read until now — opts an item back into strict matching. Dropdowns follow their children.
Version 22.7.2 - 7/27/26, 12:00 AM
fixed: aria-orientation on the menu tree: the root menubar now announces vertical when the nav renders as a sidebar (WAI-ARIA defaults menubar to horizontal), and submenu/dropdown menus declare vertical explicitly. Keyboard behavior was already orientation-aware — only the attribute was missing.
Version 22.7.1 - 7/26/26, 12:00 AM
fixed: Declared the real ng-hub-ui-utils peer range (>=22.7.0); the previous >=1.0.0 floor resolved to a utils major without resolveHubAccent.
Version 21.1.0 - 3/19/26, 12:00 AM
added: Panel drill-down expand mode with stacked side panels, configurable max visible panels, and drill-down with back navigation.
added: Per-item expandMode override (accordion, flyout, or panel) on HubNavItem.
added: Sidebar positioning with sidebarSide config (left or right).
added: Panel keyboard navigation (Escape, ArrowLeft) and automatic focus management.
added: Mobile fallback: panel mode degrades to accordion when collapsed.
added: CSS custom properties for panel styling (--hub-nav-panel-*).
Version 21.0.0 - 3/19/26, 12:00 AM
added: Initial release with horizontal and vertical navigation.
added: Data-driven API with HubNavItem interface supporting link, dropdown, header, separator, and custom types.
added: Unlimited dropdown nesting with recursive rendering.
added: Responsive collapsing with offcanvas, dropdown, and fullscreen mobile panel modes.
added: Vertical accordion and flyout expand modes.
added: Start/end slots via hubNavStart and hubNavEnd directives, plus custom item templates via hubNavItemTemplate.
added: Full Angular Router integration with routerLink, routerLinkActive, fragment, and queryParams support.
added: WCAG 2.1 AA keyboard navigation with WAI-ARIA menubar/menu pattern.
added: Complete CSS custom properties token set with 60+ variables.
added: HubNavConfigService with InjectionToken for global default configuration.