Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

DocsLayout

A documentation shell with navigation and article content.

Preview

Live preview

Changes apply to this preview only.

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Article with an outline

A real article, guide destinations and headings inside this preview document.

Open preview

Narrow guide navigation

A real article, guide destinations and headings inside this preview document.

Open preview

Article only

Without toc or footer, the grid collapses to sidebar plus main; a numeric sidebarWidth is converted to pixels.

Open preview

Usage

Keep layout responsibilities separate from the content and search implementation.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluDocsLayoutProps

Type source
PimoluDocsLayoutProps public API
NameTypeDefaultDescription
headerReactNode—Optional top bar, typically a Navbar.
sidebarRequiredReactNode—Sidebar content, typically a navigation.
childrenRequiredReactNode—The article or page content, rendered inside the main landmark.
tocReactNode—Optional table of contents, typically a TableOfContents.
footerReactNode—Optional footer rendered after the content grid.
sidebarWidthstring | number | undefined16remWidth of the sidebar column. Numbers are pixels; strings accept any CSS length. Defaults to 16rem.
tocWidthstring | number | undefined14remWidth of the TOC column. Numbers are pixels; strings accept any CSS length. Defaults to 14rem.
stickyboolean | undefinedfalseStick the sidebar and TOC while the page scrolls. Defaults to false.
classNamestring | undefined—Public Pimolu prop; see the source declaration for details.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLDivElement> | undefined—Standard React/HTML attribute.
header

ReactNode

No default extracted.

Optional top bar, typically a Navbar.

sidebarRequired

ReactNode

No default extracted.

Sidebar content, typically a navigation.

childrenRequired

ReactNode

No default extracted.

The article or page content, rendered inside the main landmark.

toc

ReactNode

No default extracted.

Optional table of contents, typically a TableOfContents.

footer

ReactNode

No default extracted.

Optional footer rendered after the content grid.

sidebarWidth

string | number | undefined

Default: 16rem

Width of the sidebar column. Numbers are pixels; strings accept any CSS length. Defaults to 16rem.

tocWidth

string | number | undefined

Default: 14rem

Width of the TOC column. Numbers are pixels; strings accept any CSS length. Defaults to 14rem.

sticky

boolean | undefined

Default: false

Stick the sidebar and TOC while the page scrolls. Defaults to false.

className

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onChange

ChangeEventHandler<HTMLDivElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLDivElement> | undefined

No default extracted.

Standard React/HTML attribute.

Accessibility

  • Verify landmarks and heading order; the live preview is isolated to avoid nested main regions.
Read the accessibility guide →