CngxTocConfig
projects/ui/toc/config/toc.config.ts
Import#
import { CngxTocConfig } from '@cngx/ui/toc'
Description#
App-wide cascade for the table-of-contents organism's ARIA label, its
scroll behaviour, the CngxScrollSpy defaults it forwards, and the default
item template.
Resolution priority (high -> low):
- Per-instance Input binding (e.g.
[contentRoot],*cngxTocItem). provideTocConfigAt(...)in a parent component'sviewProviders(component-scoped override).provideTocConfig(...)at the application root.- Library defaults (English; merged in via
CNGX_TOC_DEFAULTS).
Every key is optional - partial overrides deep-merge with the library defaults, so consumers declare only the keys they want to override.
Index#
Properties
Instance Properties#
literal typeARIA-string fallback for the nav landmark. A per-instance
[navLabel]-equivalent binding is not exposed; the landmark name always
comes from this cascade, English by default.
"auto" | "smooth"Scroll behaviour used when a link is activated and the section is
brought into view. 'smooth' by default; swapped to 'auto' (instant)
at runtime whenever prefers-reduced-motion: reduce matches, regardless
of this value.
literal typeDefaults forwarded to the internal CngxScrollSpy. Per-instance
[rootMargin] / [threshold] inputs still win; this only moves the
cascade default. contentRoot has no cascade default - it is viewport
(null) unless bound per instance.
literal typeGlobal default template slots. The item slot resolves three-stage:
per-instance *cngxTocItem -> this templates.item -> the built-in
plain-label rendering. Set it to give every un-slotted toc the same
custom item markup.