Files
payloadcms/test/admin/components/EditMenuItems/index.tsx
Jessica Rynkar 625d8d9319 feat(ui): adds new editMenuItems custom component (#12649)
## What
Adds a new custom component called `editMenuItems` that can be used in
the document view.
This options allows users to inject their own custom components into the
dropdown menu found in the document controls (the 3 dot menu), the
provided component(s) will be added below the default existing actions
(Create New, Duplicate, Delete and so on).

## Why
To increase flexibility and customization for users who wish to add
functionality to this menu. This provides a clean and consistent way to
add additional actions without needing to override or duplicate existing
UI logic.

## How
- Introduced the `editMenuItems` slot in the document controls dropdown
(three-dot menu) - in edit and preview tabs.
- Added documentation and tests to cover this new custom component

#### Testing
Use the `admin` test suite and go to the `edit menu items` collection
2025-06-03 14:57:48 +01:00

18 lines
394 B
TypeScript

'use client'
import { PopupList } from '@payloadcms/ui'
import { Banner } from '../Banner/index.js'
export const EditMenuItems = () => {
return (
<>
<PopupList.ButtonGroup>
<PopupList.Button>Custom Edit Menu Item</PopupList.Button>
<Banner message="Another using a banner" />
<div>Another in a plain div</div>
</PopupList.ButtonGroup>
</>
)
}