Upload Helpers
Payload's upload helpers support the file-management interface around an upload-enabled Collection. Use them when extending an upload workflow that already has a document, upload configuration, and the surrounding Admin context.
Import
File details
FileDetails presents a file thumbnail, URL, dimensions, size, and MIME type. It can also display removal, image-adjustment, generated-size, and custom upload actions.
The component renders a static summary by default. Pass the sortable row props when it represents one item in a multi-upload field.
Generated image sizes
PreviewSizes lets users compare the original upload with image sizes generated by the Collection's upload configuration.
The available options come from uploadConfig.imageSizes and matching entries in doc.sizes. Selecting an option updates the main preview and metadata.
Image adjustments
EditUpload provides Payload's crop and focal-point controls. Use showCrop and showFocalPoint to expose the adjustments enabled by the upload Collection.
onSave receives the crop, focal point, and resulting pixel dimensions. The component closes Payload's upload-edit modal after applying the changes.
Common props
These are the props most commonly used with this component family. See the exported types in @payloadcms/ui for the complete list.
FileDetails
Prop | Type | Default | Description |
|---|---|---|---|
| | — | Identifies the upload-enabled Collection. |
| | — | Supplies file metadata and generated sizes. |
| | — | Controls previews and available upload behavior. |
| | | Shows the image-adjustment action. |
| | | Shows the generated-size preview action. |
| | | Hides the file-removal control. |
| | — | Adds project-specific upload actions. |
PreviewSizes
Prop | Type | Default | Description |
|---|---|---|---|
| | — | Supplies original and generated image metadata. |
| | — | Defines the configured image-size order. |
| | — | Appends a cache-busting tag to preview URLs. |
EditUpload
Prop | Type | Default | Description |
|---|---|---|---|
| | — | Labels the image being edited. |
| | — | Supplies the image URL. |
| | — | Receives the applied image adjustments. |
| | | Enables crop controls. |
| | | Enables focal-point controls. |
| | — | Sets the initial crop region. |
| | — | Sets the initial focal point by percentage. |
* An asterisk denotes that a prop is required.
Accessibility
- Provide meaningful upload
altdata so generated-size previews describe the underlying image. - Keep file names and metadata available alongside visual thumbnails.
- Preserve keyboard access when adding custom upload actions.
- Label destructive removal actions clearly and confirm them when removal cannot be reversed.
Provider requirements
FileDetails and EditUpload rely on upload, translation, and modal behavior supplied by the Admin Panel. PreviewSizes expects the normalized document and upload configuration produced by an upload-enabled Collection. For complete form and persistence behavior, use Upload.
Was this page helpful?