Skip to content

Docs shell

A documentation layout: a sidebar of collapsible nav sections, a reading column, and an "On this page" rail that follows the column's headings.

Composes Nav, Toc, and Badge (plus the layout primitives).

You are inside this pattern right now

The shell around this page (the sidebar, this reading column, and the rail on the right) is the same composition at full size: the library's vertical Nav and Toc, skinned with plain CSS on the role tokens.

Demo

Install & import

Get the library into a project and render a first component in a few short steps.

Requirements

Any bundler that resolves package exports works. The library ships plain modules and plain CSS, so there is no build plugin to install and no compiler configuration to copy.

Styles are optional at every tier: the components run headless, and the theme is a separate import you add when you want the styled starting point.

Install

Add the package with your package manager of choice, then import the theme once at the app root. Every component after that is a named import. There are no barrel side effects, so your bundler keeps only what a page renders.

The first render is the whole integration test: if a styled button shows up, the tokens, the theme, and the component layer are all wired.

Theme your app

Override a palette token and every role that references it follows: borders, muted text, and tinted surfaces all chain through the token graph. Most brands need only a handful of overrides.

Dark mode is one attribute on the root element. The palette re-resolves per mode, and components never know the difference because they read roles, not raw hues.

Ship it

Check your overridden pairings against WCAG with the exported contrast helpers, run your usual build, and deploy. The library adds no runtime beyond the components you render.

Source

The whole pattern, verbatim. Every import is a public export. Copy it into an app with the theme installed and it renders the same.