Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Navigation Controls

Payload's navigation controls support the Admin Panel's menu, collapsible groups, and step navigation. These components are intended for Custom Components rendered inside the Admin Panel.

Import

1
import { Hamburger, NavGroup, NavToggler, SetStepNav } from '@payloadcms/ui'
Loading component example…

Hamburger renders the visual open or closed state. NavToggler provides the Admin-aware button that opens and closes the navigation and saves the desktop preference.

1
<NavToggler>
2
<Hamburger />
3
</NavToggler>

NavGroup renders a labeled, collapsible group in the Admin navigation. Its open state is persisted through Payload's preferences provider.

1
<NavGroup label="Group label">
2
<a href="/admin/example">Navigation item</a>
3
</NavGroup>

label is required and is used both as the visible group heading and as the key the open state is stored under in preferences. Pass isOpen to choose the group's initial state.

Step navigation

SetStepNav updates the Admin Panel's current step navigation and renders no visible element itself.

1
<SetStepNav
2
nav={[
3
{ label: 'Collection', url: '/admin/collections/example' },
4
{ label: 'Document' },
5
]}
6
/>

Each item accepts a label and an optional url. Keep the nav array stable when possible so the context is not updated on every render.

Common props

These are the props most commonly used. See the exported types in @payloadcms/ui for the complete list.

Prop

Type

Default

Description

label *

string

Labels the group and keys its saved state.

children *

ReactNode

Renders the navigation items in the group.

isOpen

boolean

Sets the group's initial expanded state.

Prop

Type

Default

Description

children

ReactNode

Renders the button contents.

className

string

Adds a class to the toggle button.

id

string

Sets the button ID.

tabIndex

number

0

Sets the button's keyboard navigation order.

* An asterisk denotes that a prop is required.

Provider requirements

NavToggler and NavGroup depend on the navigation, preferences, translation, and window information supplied by the Admin Panel. SetStepNav depends on Payload's step navigation context. Use them within Admin Panel Custom Components rather than as standalone website navigation primitives.

Was this page helpful?

Next

Pill