Edit View
The Edit View is where users interact with individual Collection and Global Documents within the Admin Panel. The Edit View contains the actual form in which 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.
Custom Edit View
To swap out the entire Edit View with a Custom View, use the views.edit.default
property in your Collection Config or Global Config:
Here is an example of a custom Edit View:
Server Component
Client Component
For details on how to build Custom Views, including all available props, see Building Custom Views.
Custom Components
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.
Collections
To override Edit View components for a Collection, use the admin.components.edit
property in your Collection Config:
The following options are available:
Path | Description |
---|---|
| A button that saves the current document. More details. |
| A button that saves the current document as a draft. More details. |
| A button that publishes the current document. More details. |
| A button that previews the current document. More details. |
| A description of the Collection. More details. |
| A file upload component. More details. |
Globals
To override Edit View components for Globals, use the admin.components.elements
property in your Global Config:
The following options are available:
Path | Description |
---|---|
| A button that saves the current document. More details. |
| A button that saves the current document as a draft. More details. |
| A button that publishes the current document. More details. |
| A button that previews the current document. More details. |
| A description of the Global. More details. |
SaveButton
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:
Here's an example of a custom SaveButton
component:
Server Component
Client Component
SaveDraftButton
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:
Here's an example of a custom SaveDraftButton
component:
Server Component
Client Component
PublishButton
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:
Here's an example of a custom PublishButton
component:
Server Component
Client Component
PreviewButton
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:
Here's an example of a custom PreviewButton
component:
Server Component
Client Component
Description
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:
Here's an example of a custom Description
component:
Server Component
Client Component
Upload
The Upload
property allows you to render a custom file upload component in the Edit View.
To add an Upload
component, use the components.edit.Upload
property in your Collection Config:
Here's an example of a custom Upload
component: