docsNavTools
Finishes a server-rendered docs sidebar in the browser.
import { docsNavTools } from "@sdxc/ui/docs";Usage
Works on the closest [data-docs-nav] around its host. The current link is the one with
aria-current="page". When the host holds an <input>, typing hides every li whose
title misses the query, hides sections left empty, opens <details> groups holding a
match, and shows [data-docs-nav-empty] when nothing matches; clearing the field restores
every group's own open state. A page reload that resets the tree keeps the query applied.
The host is hidden until this runs, so a page without script never shows an inert field.
Signature
docsNavTools(): MixinDescriptor<HTMLElement>Examples
<div data-docs-nav><div hidden mix={[docsNavTools()]}><input type="search" /></div><nav>…</nav></div>Used with it
The events, constants and types its module publishes, each imported from @sdxc/ui/docs too.
filterDocsNav
Shows the pages whose title holds every word of query, case- and accent-insensitive,
with the groups and sections that contain them; a group whose own title matches keeps all
its pages. An empty query restores the full tree and each group's own open state.
filterDocsNav(nav: HTMLElement, query: string, ownState: Map<HTMLDetailsElement, boolean>)| Parameter | Type | Required | Description |
|---|---|---|---|
nav | HTMLElement | Yes | |
query | string | Yes | |
ownState | Map<HTMLDetailsElement, boolean> | Yes |