Skip to main content

DocsLayout

Function DocsLayout 

Source
pub fn DocsLayout(_: DocsLayoutProps) -> Element
Expand description

Documentation layout shell.

Renders the tab bar, sidebar, content area, search modal, and mobile drawer. The consumer wraps this in their own navbar via Dioxus route layouts.

§Context requirements

  • &'static DocsRegistry — provided by consumer
  • DocsContext — provided by consumer

§Props

  • header: Optional element to render inside the docs area header (e.g. branding + search button). If not provided, a default header with search button and hamburger is rendered.
  • show_header: Whether to render the internal header area (default header/custom header and tab bar). Defaults to true. Set to false when the consumer provides their own header and tab bar outside of DocsLayout.
  • announcement_bar: Optional element rendered at the very top, above header.
  • sidebar_header: Optional element rendered above the generated sidebar nav.
  • sidebar_footer: Optional element rendered below the generated sidebar nav (e.g. “Edit this page” links).
  • footer: Optional element rendered at the bottom of the layout (site-wide footer).
  • variant: Density preset (Prose default, Reference for denser API/reference docs).
  • children: The routed page content (from Outlet or explicit child).

§Stable public classes

DocsLayout tags its structural nodes with semver-stable dk-* classes so CSS overrides don’t drift: dk-root, dk-docs-root, dk-header, dk-shell, dk-sidebar, dk-main, and slot wrappers like dk-announcement-slot.

§Props

For details, see the props struct definition.