SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

DocsLayout

The shell a docs page composes into.

Open in a new tab
View code
tsx
<DocsLayout
	sidebar={<DocsNav tree={tree} activePath={url.pathname} />}
	toc={anchors}
	tocLabel="On this page"
	menuLabel="Menu"
	drawerLabel="Documentation"
	closeLabel="Close menu"
	header={<SiteHeader … />}
	stickyTop="4rem"
>
	<h1>Install the CLI</h1>
	…
</DocsLayout>

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 { DocsLayout } from "@sdxc/ui/docs";

Renders the three columns and their narrow-screen fallbacks. Load @sdxc/ui/docs/table-of-contents and @sdxc/ui/dialog-dismiss in the browser entry. Headings with an id in the article get a scroll-margin-top that clears the sticky chrome, and --ui-docs-scroll-margin carries the same offset for anything else jumped to.

Props

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

PropTypeRequiredDescription
sidebarRemixNodeYesThe tree to read through, usually a DocsNav; drawn docked and again in the drawer.
childrenRemixNodeYesThe article: a page header, the prose, then its pager and next steps.
tocTableOfContents.Item[]NoThe page's own headings; fewer than tocMinItems draw neither rail nor bar list.
tocLabelstringYes"On this page", for the rail's heading and the bar.
tocMinItemsnumberNo
menuLabelstringYesThe bar button that opens the drawer below the dock width ("Menu").
drawerLabelstringYesThe drawer's heading and accessible name ("Documentation").
closeLabelstringYesThe drawer's close button's accessible name ("Close menu").
railFooterRemixNodeNoDrawn under the headings in the rail, such as feedback or an edit link.
footerRemixNodeNoCloses the page across the article and rail columns, never under the sidebar, so the docked sidebar runs to the viewport's foot; usually a DocsFooter.
headerRemixNodeNoA site header drawn above the shell, kept on screen as the page scrolls.
stickyTopstringNoThe height of everything kept on screen above the shell (the header slot, or a site header the app draws around the layout), so sticky columns and jumped-to headings sit below it.
dockDockNo
measurestringNoThe article column's widest extent, which code, images, tables and charts may fill.
proseMeasurestringNoThe widest line of running text: paragraphs, lists, headings, quotes and callouts stop here while wider blocks keep growing to measure. Readable prose sits at 60–75ch.
maxWidthstringNoThe whole shell's widest extent. @default "88rem"
mainbooleanNoWhether the article column is the page's <main> landmark; pass false when the app's own layout already draws one around the shell.
drawerIdstringNoShared by the drawer and the button that opens it. @default "docs-drawer"
@sdxc/ui

Can’t find it? Contact us