Step Navigation
Step navigation is the breadcrumb trail rendered in the Admin Panel header. In a Custom View, use SetStepNav or useStepNav to populate that existing interface—you do not need to render another breadcrumb component.
Import
Custom View usage
Use SetStepNav when the complete breadcrumb trail is known while rendering the Custom View.
SetStepNav renders no visible element itself. It updates the step navigation provider that surrounds Admin Panel views, and the header displays the resulting items.
Define a static nav array outside the component when its contents do not change. This keeps the array reference stable and avoids updating the context after every render.
Dynamic navigation
Use useStepNav when breadcrumb items depend on state that changes while the view remains mounted.
Prefer SetStepNav unless you need direct access to the current stepNav value or need to update it in response to local state.
StepNavItem
Each item contains a label and may contain a url.
Property | Type | Description |
|---|---|---|
| | Displays the translated or custom breadcrumb label. |
| | Makes a non-current breadcrumb item navigable when present. |
The final item represents the current location and is rendered as text. Earlier items with a url are rendered as links.
* An asterisk denotes that a property is required.
SetStepNav props
These are the props accepted by SetStepNav.
Prop | Type | Default | Description |
|---|---|---|---|
| | — | Replaces the items displayed in the Admin header. |
* An asterisk denotes that a prop is required.
Accessibility
- Use short labels that identify each level in the current hierarchy.
- Keep the current location as the final item.
- Provide URLs for earlier items when users can safely return to those views.
- Avoid duplicating the current page heading in every breadcrumb level.
Provider requirements
SetStepNav and useStepNav depend on the step navigation provider already included in the Payload Admin Panel. Use them within an Admin Panel Custom Component or Custom View. Outside that context, setting the navigation is a no-op.
See Custom Views for configuring a view in the Admin Panel.
Was this page helpful?