---
title: "Ui Layouts Layout"
description: "Fumadocs layout subsystems establish a robust architectural foundation for documentation and marketing applications, sharing common link-resolution mechanisms (Shared Layout Architecture), tree con..."
last_updated: "2026-10-12T07:53:59.981993+00:00"
canonical_url: "https://www.doc0.dev/docs/e8872a72-1909-479c-b585-dc74c6e26726/ui-layouts/ui-layouts-layout"
---


## Overview

Fumadocs layout subsystems establish a robust architectural foundation for documentation and marketing applications, sharing common link-resolution mechanisms ([Shared Layout Architecture](https://www.doc0.dev/docs/e8872a72-1909-479c-b585-dc74c6e26726/ui-layouts/shared-layout-architecture)), tree context providers, and design tokens across different user interface frameworks. The system centers on composable slots, context providers, and dynamic link resolution via `resolveLinkItems` and `useLinkItems`, allowing developers to structure navigation items into designated menu buckets or inline header links.


The application packages provide three distinct layout variants—Flux, Home, and Notebook—that consume these shared primitives to organize sidebars, responsive navigation bars, and article viewports.


```mermaid
graph TD
    A["BaseLayoutProps"] --> B["resolveLinkItems"]
    B --> C["useLinkItems"]
    C --> D["LayoutContext"]
    D --> E["Flux Layout"]
    D --> F["Home Layout"]
    D --> G["Notebook Layout"]
```


## Flux Documentation Layout

The Flux layout arranges a modern documentation experience featuring a responsive navigation panel, a customizable sidebar drawer system, and a centered article container. The layout entry point `DocsLayout` initializes a `LayoutContext` carrying resolved menu items, base layout properties, and slot mappings, wrapping its descendants in a `TreeContextProvider` and a sidebar provider.


```mermaid
graph TD
    A["DocsLayout"] --> B["TreeContextProvider"]
    B --> C["sidebar.provider"]
    C --> D["slots.container"]
    D --> E["sidebar.root"]
    D --> F["children / DocsPage"]
    C --> G["NavigationPanel"]
```


Layout tabs are derived dynamically from the page tree using `getLayoutTabs`, or passed explicitly as an array of `LayoutTab` objects. The `NavigationPanel` renders header elements, language selectors, search triggers, theme switches, and icon links within a motion-animated header container.


```typescript
export interface DocsLayoutProps extends BaseLayoutProps {
  tree: PageTree.Root;
  sidebar?: SidebarOptions;
  tabs?: LayoutTab[] | GetLayoutTabsOptions | false;
  slots?: Partial<DocsSlots>;
  renderNavigationPanel?: (props: NavigationPanelProps) => ReactNode;
  containerProps?: ComponentProps<'div'>;
}
```


The Flux sidebar component uses `SidebarContent` with `RemoveScroll` to manage keyboard escape event listeners, backdrop blurs, and animated entrance/exit states when toggled open.


## Home Layout

The Home layout provides a marketing or landing page structure via `HomeLayout`, rendering a top navigation header and a main content container. It resolves navigation links through `useLinkItems` and makes them available via `useHomeLayout`.


```mermaid
graph TD
    A["HomeLayout"] --> B["HomeSlots Context"]
    B --> C["slots.container"]
    C --> D["slots.header"]
    C --> E["children"]
```


The header slot utilizes `HeaderNavigationMenu` to support transparent mode variants (`always`, `top`, or `none`). When `transparentMode` is set to `top`, it monitors scroll position via `useIsScrollTop` to toggle background opacities dynamically.


```typescript
export interface HomeLayoutProps extends BaseLayoutProps, ComponentProps<'main'> {
  nav?: Nav;
  slots?: Partial<HomeSlots>;
}
```


Mobile viewports automatically switch to a collapsible navigation menu dropdown triggered by a chevron button, which renders both primary and secondary link items alongside language selectors and theme switches.


## Notebook Layout

The Notebook layout implements a multi-column CSS grid architecture containing a sidebar, a sticky subheader, a [table of contents](https://www.doc0.dev/docs/e8872a72-1909-479c-b585-dc74c6e26726/ui-layouts/table-of-contents), and a central article viewport. The grid columns are dynamically computed based on sidebar collapse states and layout width variables.


```mermaid
graph TD
    A["LayoutBody"] --> B["TreeContextProvider"]
    B --> C["SidebarProvider"]
    C --> D["Container (CSS Grid)"]
    D --> E["Header / Subnav"]
    D --> F["Sidebar Root"]
    D --> G["Page Children"]
```


The header execution flow for `Header` coordinates touch detection, responsive menus, and navigation items. When evaluating `Header`, it delegates item rendering to `NavbarLinkItem` and `NavbarLinkItemMenu`.


```mermaid
sequenceDiagram
    participant Header as Header
    participant Item as NavbarLinkItem
    participant Menu as NavbarLinkItemMenu
    Header->>Item: Render navItems
    alt item.type === 'menu'
        Item->>Menu: Delegate item rendering
        Menu->>Menu: Handle pointer events & popover state
    else item.type === 'main' or standard link
        Item->>Item: Render LinkItem component
    end
```


The grid template adapts depending on whether `nav.mode` is set to `top` or `auto`:


```typescript
gridTemplate:
  nav?.mode === 'top'
    ? `". header header header ."
"sidebar sidebar toc-popover toc-popover ."
"sidebar sidebar main toc ." 1fr / minmax(min-content, 1fr) var(--fd-sidebar-col) minmax(0, ${pageCol}) var(--fd-toc-width) minmax(min-content, 1fr)`
    : `"sidebar sidebar header header ."
"sidebar sidebar toc-popover toc-popover ."
"sidebar sidebar main toc ." 1fr / minmax(min-content, 1fr) var(--fd-sidebar-col) minmax(0, ${pageCol}) var(--fd-toc-width) minmax(min-content, 1fr)`
```


> [!NOTE]
> During sidebar collapse state transitions, `Container` sets `data-column-changed=true` for an instant to trigger smooth CSS grid template column transitions.


## Related

- [Shared Layout Architecture](https://www.doc0.dev/docs/e8872a72-1909-479c-b585-dc74c6e26726/ui-layouts/shared-layout-architecture)


## Sitemap

See the full [sitemap](https://www.doc0.dev/docs/e8872a72-1909-479c-b585-dc74c6e26726/llms.txt) for all pages in this wiki.
