Used to manage single and multiple file uploads.
Examples
No files uploaded yet
Drag and drop files here or
Contents
<>
{files.length ? (
<FileUploadViewer files={files} />
) : (
<Paragraph>No files uploaded yet</Paragraph>
)}
<DroppableFileUploadField
id="file-upload-1"
name="file-upload-1"
label="Upload files"
multiple={true}
onChange={(files) =>
setFiles(
files.map((file) => ({ file, status: FileUploadStatus.pending }))
)
}
/>
</>
How to use this component
Upload requires two components FileUploadViewer and DroppableFileUploadField. The droppable file uploader accepts one or more files and the viewer displays the state of those files.
Files can be uploaded, uploading, pending or errored and actions can be made against them.
When to use this component
Use this when you want to support the upload of one or more files.
Validation of uploads can be either client or server-side.
Research on this component
User research has shown that this component successfully conveys a status to users. It has been shown to be distinctive from a call to action button and rarely confused for one.
Services using this pattern
- Digital Submission Service
