SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

DocsNav

A docs sidebar drawn from a DocsTree.

View code
tsx
<DocsNav
	tree={tree}
	activePath="/docs/alerts/webhooks"
	collapseGroups
	filter={{ label: "Filter pages", placeholder: "Filter pages", noResults: "No page matches" }}
	footer={<a href="/support">Contact support</a>}
/>

Demo docs sites

Whole pages built only from @sdxc/ui, each for an invented product with its own palette and type. They open in a new tab.

Every demo, landings and docs sites alike, is listed in the demo gallery.

Installation

An ordinary dependency: install it, import the theme once, and import the component where it is used.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
import { DocsNav } from "@sdxc/ui/docs";

Renders the tree in reading order. A group whose href is set links its own page from its summary, and every group is a native <details>, so folding needs no script. Load @sdxc/ui/docs/docs-nav-tools in the browser entry for the scroll-to-current and the filter.

Examples

tsx
<DocsNav tree={tree} activePath={path} filter={{ label: "Filter pages", placeholder: "Filter", noResults: "No page matches" }} footer={<a href="/support">Contact support</a>} />

Props

Read from the component's own types, so every prop, every default and every allowed value is listed.

PropTypeRequiredDescription
treeDocsTreeYesThe pages to list; tree.label names the navigation landmark.
activePathstringYesThe path being read, which marks one link aria-current="page".
filter{ label: string; placeholder: string; noResults: string }NoA field that filters pages by title, with the line shown when nothing matches. It appears once the page's script loads.
footerRemixNodeNoDrawn under the tree, such as "Contact support" or a status link, flush with the nav's edge; give its links the rows' inline padding (or render them as Sidebar.MenuLinks) to line their text up with the pages above.
collapseGroupsbooleanNoFolds every group except the ones holding the current page, for a tree whose groups run to hundreds of pages.
prefetchSidebar.PrefetchNoWhen a link prefetches its page.
@sdxc/ui

Can’t find it? Contact us