Component docs
Loading
import { DocumentationLayout } from "@pixxl-tools/components";
// In Server Components:
import { DocumentationLayout } from "@pixxl-tools/components/server";| Prop | Type | Default | Description |
|---|---|---|---|
children (required) | ReactNode | — | — |
sidebar (required) | ReactNode | — | — |
currentLabel | ReactNode | — | Current section, shown on the mobile menu button. |
menuLabel | string | "Sections" | Label of the mobile menu button (default "Sections"). |
stickySidebar | boolean | true | Keep the sidebar in view (default true): sticky beside the content from md up, and below md the "Sections" button sticks under the header (its open list scrolls inside the remaining height). |
childrenrequiredReactNode
sidebarrequiredReactNode
currentLabelReactNode
Current section, shown on the mobile menu button.
menuLabeldefault "Sections"string
Label of the mobile menu button (default "Sections").
stickySidebardefault trueboolean
Keep the sidebar in view (default true): sticky beside the content from md up, and below md the "Sections" button sticks under the header (its open list scrolls inside the remaining height).
Other props are passed to the root element (HTMLAttributes<HTMLDivElement>), including className, style, id and aria-* attributes.
Documentation content.
const sections = [
{ id: "install", label: "Install", href: "#install" },
{ id: "usage", label: "Usage", href: "#usage" },
];
const section = sections[0];
<DocumentationLayout currentLabel={section.label} sidebar={<AnchorNav items={sections} scrollSpy />}><MarkdownProse>...</MarkdownProse></DocumentationLayout>