You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: adds settingsMenu to admin navigation sidebar (#14139)
### What?
Adds a new `admin.components.settingsMenu` configuration option that
allows users to inject custom menu items into the navigation. When
configured, a gear icon appears above the logout button in the
navigation sidebar. Clicking the gear icon opens a popup menu displaying
the custom components.
<img width="130" height="177" alt="Screenshot 2025-10-14 at 11 43 18 AM"
src="https://github.com/user-attachments/assets/5583e32d-cde3-45f0-9d58-a6724c12509f"
/>
<img width="174" height="239" alt="Screenshot 2025-10-14 at 11 43 37 AM"
src="https://github.com/user-attachments/assets/5dca8ea7-ed99-4bc1-89c2-bc6da7d8f323"
/>
### Why?
Users need a way to add custom actions and menu items to the admin
navigation without replacing the entire navigation component. This
provides a standardized location for admin-level utilities and actions
that don't fit into collection or global navigation.
### How?
- Added `settingsMenu` property to `admin.components` config type
definition
- Created `GearIcon` component following the existing icon patterns
- Exported `GearIcon` from the UI package exports
- Implemented `SettingsMenuButton` client component that renders a popup
menu with the gear icon trigger
- Integrated `SettingsMenuButton` into `DefaultNav` component,
positioned above the logout button
- Updated import map generation to include `settingsMenu` components
Copy file name to clipboardExpand all lines: docs/custom-components/root-components.mdx
+60Lines changed: 60 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,7 @@ The following options are available:
45
45
|`header`| An array of Custom Components to be injected above the Payload header. [More details](#header). |
46
46
|`logout.Button`| The button displayed in the sidebar that logs the user out. [More details](#logoutbutton). |
47
47
|`Nav`| Contains the sidebar / mobile menu in its entirety. [More details](#nav). |
48
+
|`settingsMenu`| An array of Custom Components to inject into a popup menu accessible via a gear icon above the logout button. [More details](#settingsMenu). |
48
49
|`providers`| Custom [React Context](https://react.dev/learn/scaling-up-with-reducer-and-context) providers that will wrap the entire Admin Panel. [More details](./custom-providers). |
49
50
|`views`| Override or create new views within the Admin Panel. [More details](./custom-views). |
50
51
@@ -271,6 +272,65 @@ export default function MyAfterNavLinksComponent() {
271
272
}
272
273
```
273
274
275
+
### settingsMenu
276
+
277
+
The `settingsMenu` property allows you to inject Custom Components into a popup menu accessible via a gear icon in the navigation controls, positioned above the logout button. This is ideal for adding custom actions, utilities, or settings that are relevant at the admin level.
278
+
279
+
To add `settingsMenu` components, use the `admin.components.settingsMenu` property in your Payload Config:
You can pass multiple components to create organized groups of menu items:
317
+
318
+
```ts
319
+
import { buildConfig } from'payload'
320
+
321
+
exportdefaultbuildConfig({
322
+
// ...
323
+
admin: {
324
+
components: {
325
+
settingsMenu: [
326
+
'/components/SystemActions#SystemActions',
327
+
'/components/DataManagement#DataManagement',
328
+
],
329
+
},
330
+
},
331
+
})
332
+
```
333
+
274
334
### Nav
275
335
276
336
The `Nav` property contains the sidebar / mobile menu in its entirety. Use this property to completely replace the built-in Nav with your own custom navigation.
0 commit comments