Navigation
Build sectioned, ordered navigation from content metadata.
On this page
ngxdocs represents navigation as a tree of documents, categories, separators, and breaks. The docs application generates that tree from meta.json; library consumers can also provide the same SidebarNode[] structure directly.
Documents
A document has an id, display label, and optional description, icon, and badge. An empty id points to /docs; nested IDs map to nested docs URLs.
Categories
Categories contain more navigation nodes. Set defaultOpen for folders that should start expanded. The active page trail opens automatically, while user toggles remain local to the current route.
Root sections
Metadata files with root: true appear in the section switcher above the sidebar. This is useful for keeping framework, UI, headless, CLI, and API documentation in one site without displaying one enormous tree.
Derived navigation
flattenSidebar() converts the visible tree into a linear list. The page header and footer use that list for previous and next links, which guarantees that keyboard-like navigation follows the order readers see in the sidebar.
Last updated on
Let us know whether this page helped you.