Angular Navigation Menu Component | ng-hub-ui-nav

Angular navigation component with dropdowns, drill-down panels, responsive collapse, router integration and CSS-variable theming.

API reference

Here's the full contract for nav: everything you can bind, listen to, project and theme, gathered in one place. Wire up what you need and style what you want — it's standalone and signal-friendly.

Inputs

Dial nav in with 4 inputs. Bind them like any Angular @Input.

NameTypeDefaultDescription
itemsRequiredHubNavItem[]Array of navigation items to render. Each item defines its type (link, dropdown, header, separator, custom), label, route, icon, badge, children, and more.
configPartial<HubNavConfig>{}Partial configuration overrides merged with global defaults. Controls orientation, dropdown trigger, collapse mode, breakpoint, position, and more.
navClassstring''Additional CSS class applied to the nav container element.
itemTemplateTemplateRef<HubNavItemTemplateContext> | nullnullOptional custom template for rendering nav items via input binding. The hubNavItemTemplate directive takes priority over this input.

Outputs

React to what nav does — 5 events to hook your logic onto.

NameTypeDescription
itemClickOutputEmitterRef<HubNavItem>Emitted when a link item is clicked. Provides the clicked HubNavItem.
dropdownOpenOutputEmitterRef<HubNavItem>Emitted when a dropdown item is opened.
dropdownCloseOutputEmitterRef<HubNavItem>Emitted when a dropdown item is closed.
mobileToggleOutputEmitterRef<boolean>Emitted when the mobile panel is toggled. Provides true when open, false when closed.
panelChangeOutputEmitterRef<HubNavPanelEvent>Emitted when a panel is opened, closed, drilled-down, or navigated back. Provides the item, panel index, and action type.

Templates

Make it yours — 3 template slots let you project custom markup.

NameDescriptionExample
hubNavStartProjects custom content in the start slot. Horizontal: visual start (left in LTR, right in RTL). Vertical: top of the primary column.<hub-nav [items]="items"> <ng-template hubNavStart let-collapsed="collapsed"> <img src="logo.svg" alt="Brand" /> @if (!collapsed) { <span>App Name</span> } </ng-template> </hub-nav>
hubNavEndProjects custom content in the end slot. Horizontal: visual end (right in LTR, left in RTL). Vertical: bottom of the primary column.<hub-nav [items]="items"> <ng-template hubNavEnd> <button type="button">Sign out</button> </ng-template> </hub-nav>
hubNavItemTemplateOverrides the default item rendering with a custom template. Receives HubNavItemTemplateContext with $implicit (item), active, expanded, and depth properties.<hub-nav [items]="items"> <ng-template hubNavItemTemplate let-item let-active="active"> <span [class.fw-bold]="active">{{ item.label }}</span> @if (item.badge) { <span class="badge">{{ item.badge }}</span> } </ng-template> </hub-nav>

CSS variables

Theme every pixel with 42 CSS variables. Override them at :root or scope them to a wrapper.

Layout

Control the overall nav dimensions, padding, and spacing.

VariableDefaultTypeDescription
--hub-nav-height3.5remlength Height of the navigation bar. 3rem4remauto
--hub-nav-padding-x1remlength Horizontal padding of the nav container. 0.5rem1.5rem2rem
--hub-nav-padding-y0.5remlength Vertical padding of the nav container. 0.25rem0.75rem1rem
--hub-nav-gap0.25remlength Gap between nav items. 00.5rem1rem

Colors & Background

Control the nav color scheme and borders.

VariableDefaultTypeDescription
--hub-nav-bg#fffcolor Background color of the navigation bar. #f8f9fatransparentvar(--hub-sys-surface-page)
--hub-nav-color#212529color Base text color of the navigation. #333#fffvar(--hub-sys-text-primary)
--hub-nav-border-color#dee2e6color Border color of the navigation bar. transparent#cccvar(--hub-sys-border-color-default)

Items

Styling for individual navigation items across all states.

VariableDefaultTypeDescription
--hub-nav-item-padding-x1remlength Horizontal padding inside nav items. 0.5rem1.25rem1.5rem
--hub-nav-item-padding-y0.5remlength Vertical padding inside nav items. 0.25rem0.75rem1rem
--hub-nav-item-color#212529color Text color of nav items. #495057#fffinherit
--hub-nav-item-border-radius0.25remlength Border radius of nav items. 00.375rem50rem
--hub-nav-item-hover-bgrgba(0, 0, 0, 0.04)color Background color on hover. #e9ecefrgba(255, 255, 255, 0.1)transparent
--hub-nav-item-hover-color#0d6efdcolor Text color on hover. #0a58ca#fffvar(--hub-sys-color-primary)
--hub-nav-item-active-bg#0d6efdcolor Background color when item is active. #0a58catransparentvar(--hub-sys-color-primary)
--hub-nav-item-active-color#fffcolor Text color when item is active. #0d6efd#212529var(--hub-sys-text-inverse)
--hub-nav-item-disabled-color#6c757dcolor Text color for disabled items. #adb5bdvar(--hub-sys-text-muted)
--hub-nav-item-disabled-opacity0.65number Opacity for disabled items. 0.50.41

Dropdown

Customize dropdown panel appearance and positioning.

VariableDefaultTypeDescription
--hub-nav-dropdown-bg#fffcolor Background color of dropdown panels. #f8f9fa#343a40var(--hub-sys-surface-elevated)
--hub-nav-dropdown-border-color#dee2e6color Border color of dropdown panels. transparent#ccc
--hub-nav-dropdown-border-radius0.375remlength Border radius of dropdown panels. 00.25rem0.5rem
--hub-nav-dropdown-shadow0 0.5rem 1rem rgba(0, 0, 0, 0.15)shadow Box shadow of dropdown panels. none0 4px 8px rgba(0,0,0,0.1)0 1rem 3rem rgba(0,0,0,0.175)
--hub-nav-dropdown-min-width12remlength Minimum width of dropdown panels. 10rem15rem200px

Brand

Styling for the brand slot area.

VariableDefaultTypeDescription
--hub-nav-brand-font-size1.25remlength Font size of the brand text. 1rem1.5rem2rem
--hub-nav-brand-font-weight600number Font weight of the brand text. 400700800
--hub-nav-brand-color#212529color Text color of the brand. #fff#0d6efdinherit

Mobile Panel

Configuration for the responsive mobile navigation panel.

VariableDefaultTypeDescription
--hub-nav-mobile-bg#fffcolor Background color of the mobile panel. #f8f9fa#212529var(--hub-sys-surface-page)
--hub-nav-mobile-width18remlength Width of the offcanvas mobile panel. 15rem20rem80vw
--hub-nav-mobile-backdrop-bgrgba(0, 0, 0, 0.5)color Backdrop color behind the mobile panel. rgba(0, 0, 0, 0.3)rgba(0, 0, 0, 0.75)transparent
--hub-nav-mobile-transition300ms easetransition Transition timing for mobile panel open/close animation. 200ms ease-in-out400ms ease150ms linear

Accordion & Icons

Vertical accordion indent and icon sizing.

VariableDefaultTypeDescription
--hub-nav-accordion-indent1remlength Left indentation per nesting level in vertical accordion mode. 0.5rem1.5rem2rem
--hub-nav-icon-size1.25remlength Size of navigation item icons. 1rem1.5rem2rem
--hub-nav-icon-gap0.5remlength Gap between icon and label text. 0.25rem0.75rem1rem

Panel

Styling for the stacked panel drill-down navigation.

VariableDefaultTypeDescription
--hub-nav-panel-width16remlength Default width of each panel. 14rem18rem20rem
--hub-nav-panel-zindex100number Stacking order of panels (should be lower than dropdown z-index). 50100200
--hub-nav-panel-bgvar(--hub-sys-surface-page, #fff)color Background color of panels. #f8f9fa#fffvar(--hub-sys-surface-elevated)
--hub-nav-panel-colorvar(--hub-sys-text-primary, #212529)color Text color inside panels. #333#fffinherit
--hub-nav-panel-border-colorvar(--hub-sys-border-color-default, #dee2e6)color Border color between panels. transparent#ccc
--hub-nav-panel-shadowinset 4px 0 8px -4px rgba(0, 0, 0, 0.1)shadow Box shadow of panels. none2px 0 4px rgba(0,0,0,0.05)
--hub-nav-panel-header-height3remlength Height of the panel header. 2.5rem3.5rem4rem
--hub-nav-panel-header-bgvar(--hub-sys-surface-elevated, #f8f9fa)color Background color of the panel header. #fff#e9eceftransparent
--hub-nav-panel-back-colorvar(--hub-sys-text-secondary, #6c757d)color Color of the back button in the panel header. #212529#0d6efdinherit
--hub-nav-panel-back-hover-bgrgba(0, 0, 0, 0.04)color Hover background of panel header buttons. #e9ecefrgba(0,0,0,0.08)

Styling and theming

No styling examples are documented yet. This section will include customization recipes and theming examples.