The Edit View is where users interact with individual Collection and Global Documents within the Admin Panel. The Edit View contains the actual form that submits the data to the server. This is where they can view, edit, and save their content. It contains controls for saving, publishing, and previewing the document, all of which can be customized to a high degree.
The Edit View can be swapped out in its entirety for a Custom View, or it can be injected with a number of Custom Components to add additional functionality or presentational elements without replacing the entire view.
Note: The Edit View is one of many Document Views in the Payload Admin Panel. Each Document View is responsible for a different aspect of interacting with a single Document.
In addition to swapping out the entire Edit View with a Custom View, you can also override individual components. This allows you to customize specific parts of the Edit View without swapping out the entire view.
Important: Collection and Globals are keyed to a different property in the admin.components object and have slightly different options. Be sure to use the correct key for the entity you are working with.
The SaveButton property allows you to render a custom Save Button in the Edit View.
To add a SaveButton component, use the components.edit.SaveButton property in your Collection Config or components.elements.SaveButton in your Global Config:
1
importtype{CollectionConfig}from'payload'
2
3
exportconstMyCollection:CollectionConfig={
4
// ...
5
admin:{
6
components:{
7
edit:{
8
SaveButton:'/path/to/MySaveButton',
9
},
10
},
11
},
12
}
Here's an example of a custom SaveButton component:
The beforeDocumentControls property allows you to render custom components just before the default document action buttons (like Save, Publish, or Preview). This is useful for injecting custom buttons, status indicators, or any other UI elements before the built-in controls.
To add beforeDocumentControls components, use the components.edit.beforeDocumentControls property in your Collection Config or components.elements.beforeDocumentControls in your Global Config:
The editMenuItems property allows you to inject custom components into the 3-dot menu dropdown located in the document controls bar. This dropdown contains default options including Create New, Duplicate, Delete, and other options when additional features are enabled. Any custom components you add will appear below these default items.
To add editMenuItems, use the components.edit.editMenuItems property in your Collection Config:
Another Custom Edit Menu Item - add as many as you need!
20
</PopupList.Button>
21
</PopupList.ButtonGroup>
22
)
23
}
Styling: Use Payload's built-in PopupList.Button to ensure your menu items automatically match the default dropdown styles. If you want a different look, you can customize the appearance by passing your own className to PopupList.Button, or use a completely custom button built with a standard HTML button element or any other component that fits your design preferences.
The SaveDraftButton property allows you to render a custom Save Draft Button in the Edit View.
To add a SaveDraftButton component, use the components.edit.SaveDraftButton property in your Collection Config or components.elements.SaveDraftButton in your Global Config:
1
importtype{CollectionConfig}from'payload'
2
3
exportconstMyCollection:CollectionConfig={
4
// ...
5
admin:{
6
components:{
7
edit:{
8
SaveDraftButton:'/path/to/MySaveDraftButton',
9
},
10
},
11
},
12
}
Here's an example of a custom SaveDraftButton component:
The PublishButton property allows you to render a custom Publish Button in the Edit View.
To add a PublishButton component, use the components.edit.PublishButton property in your Collection Config or components.elements.PublishButton in your Global Config:
1
importtype{CollectionConfig}from'payload'
2
3
exportconstMyCollection:CollectionConfig={
4
// ...
5
admin:{
6
components:{
7
edit:{
8
PublishButton:'/path/to/MyPublishButton',
9
},
10
},
11
},
12
}
Here's an example of a custom PublishButton component:
The PreviewButton property allows you to render a custom Preview Button in the Edit View.
To add a PreviewButton component, use the components.edit.PreviewButton property in your Collection Config or components.elements.PreviewButton in your Global Config:
1
importtype{CollectionConfig}from'payload'
2
3
exportconstMyCollection:CollectionConfig={
4
// ...
5
admin:{
6
components:{
7
edit:{
8
PreviewButton:'/path/to/MyPreviewButton',
9
},
10
},
11
},
12
}
Here's an example of a custom PreviewButton component:
The Description property allows you to render a custom description of the Collection or Global in the Edit View.
To add a Description component, use the components.edit.Description property in your Collection Config or components.elements.Description in your Global Config:
1
importtype{CollectionConfig}from'payload'
2
3
exportconstMyCollection:CollectionConfig={
4
// ...
5
admin:{
6
components:{
7
Description:'/path/to/MyDescriptionComponent',
8
},
9
},
10
}
Note: The Description component is shared between the Edit View and the List View.
Here's an example of a custom Description component: