Skip to main content
cngx-src documentation

CngxSidenavConfig

Interface

projects/ui/sidenav/config/sidenav.config.ts

Import#

import { CngxSidenavConfig } from '@cngx/ui/sidenav'

Description#

App-wide cascade for the sidenav family's dimension defaults, the mini expand-on-hover dwell, and the responsive / shortcut behaviour knobs.

Resolution priority (high -> low):

  1. Per-instance Input binding (e.g. [width]="'320px'", [shortcut]="'mod+b'").
  2. provideSidenavConfigAt(...) in a parent component's viewProviders (component-scoped override).
  3. provideSidenavConfig(...) at the application root.
  4. Library defaults (merged in via CNGX_SIDENAV_DEFAULTS).

Every key is optional - partial overrides deep-merge with the library defaults, so consumers declare only the keys they want to override. The dimensions, hover, and routerSync sub-trees are one level deep (spread-merged per key); responsive and shortcut are flat top-level scalars.

The cascaded keys are the dimension inputs, the mini hover dwell, the responsive and shortcut defaults, and the router-sync param. ariaLabel, position, and mode stay per-instance only, since they describe an individual rail rather than an app-wide default.

Index#

Instance Properties#

dimensions#literal type
ReadonlyOptional

Panel dimensions. Per-instance [width] / [miniWidth] / [minWidth] / [maxWidth] bindings still win; this only moves the cascade defaults. A one-level nested sub-tree (spread-merged per key in the config reducer).

hover#literal type
ReadonlyOptional

Mini expand-on-hover dwell, forwarded to the composed CngxHoverIntent hostDirective. A one-level nested sub-tree. Wired via withSidenavHoverDwell(...).

responsive#string
ReadonlyOptional

Default CSS media-query string for responsive mode switching. Per-instance [responsive] still wins. A flat top-level scalar, not a nested sub-tree.

routerSync#literal type
ReadonlyOptional

URL query-param sync defaults for [cngxSidenavRouterSync]. A one-level nested sub-tree (spread-merged per key in the config reducer). Wired via withSidenavRouterSync(...); the directive resolves param as [param] ?? routerSync.param ?? 'nav', so an un-configured consumer keeps the 'nav' literal.

shortcut#string
ReadonlyOptional

Default keyboard shortcut to toggle the sidenav (e.g. 'mod+b'). Per-instance [shortcut] still wins. A flat top-level scalar.