Fumadocs

Navbar

Navbar/header configurations.

Configurations

Options for navbar (header).

Prop

Type

Transparent Mode

To make the navbar background transparent, you can configure transparent mode.

lib/layout.shared.tsx
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';

export function baseOptions(): BaseLayoutProps {
  return {
    nav: {
      title: 'My App',
      transparentMode: 'top',
    },
  };
}
ModeDescription
alwaysAlways use a transparent background
topWhen at the top of page
noneDisable transparent background (default)

Replace Navbar

To replace the navbar in different layouts, set nav.component to your own component.

lib/layout.shared.tsx
import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';

export function baseOptions(): BaseLayoutProps {
  return {
    nav: {
      component: <CustomNavbar />,
    },
  };
}

Fumadocs uses CSS Variables to share the size of layout components, and fit each layout component into appropriate position.

You need to override --fd-nav-height to the exact height of your custom navbar, this can be done with a CSS stylesheet (e.g. in global.css):

:root {
  --fd-nav-height: 80px !important;
}

How is this guide?

Last updated on

On this page