Layouts
Notebook
A more compact version of Docs Layout
Usage
Enable the notebook layout with fumadocs-ui/layouts/notebook
, it's a more compact layout than the default one.
import { DocsLayout } from 'fumadocs-ui/layouts/notebook';
import { baseOptions } from '@/app/layout.config';
import { source } from '@/lib/source';
import type { ReactNode } from 'react';
export default function Layout({ children }: { children: ReactNode }) {
return (
<DocsLayout {...baseOptions} tree={source.pageTree}>
{children}
</DocsLayout>
);
}
Configurations
The options are inherited from Docs Layout, with minor differences:
- sidebar/navbar cannot be replaced, Notebook layout is more opinionated than the default one.
- additional options (see below).
Tab Mode
Configure the style of sidebar tabs.
import { DocsLayout } from 'fumadocs-ui/layouts/notebook';
import { baseOptions } from '@/app/layout.config';
import { source } from '@/lib/source';
import type { ReactNode } from 'react';
export default function Layout({ children }: { children: ReactNode }) {
return (
<DocsLayout
{...baseOptions}
tabMode="navbar"
tree={source.pageTree}
>
{children}
</DocsLayout>
);
}
Nav Mode
Configure the style of navbar.
import { DocsLayout } from 'fumadocs-ui/layouts/notebook';
import { baseOptions } from '@/app/layout.config';
import { source } from '@/lib/source';
import type { ReactNode } from 'react';
export default function Layout({ children }: { children: ReactNode }) {
return (
<DocsLayout
{...baseOptions}
nav={{ ...baseOptions.nav, mode: 'top' }}
tree={source.pageTree}
>
{children}
</DocsLayout>
);
}
How is this guide?
Last updated on