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 } 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

Use SetStepNav or useStepNav to populate the breadcrumb trail in the Admin header from a Custom View. See Step Navigation for complete examples and API guidance.

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. Use them within Admin Panel Custom Components rather than as standalone website navigation primitives.

Was this page helpful?

Next

Pill