Overview
A file uploader allows users to upload and attach one or more files. It shows the upload progress and status of each file.
Formatting
Anatomy
- Title
- Helper text
- Button: icon is "ri-upload-line"
- File container
- File name
- Close icon: Deletes the uploaded file
Behavior
Loading States
A file that is being uploaded has three distinct states—loading, success, and uploaded.
Interactions
Mouse
To remove an uploaded file, click the “x” (or delete) icon.
Keyboard
Upload button:
- The file uploader button or drop zone can be activated by pressing Space or Enter.
- After the file selection dialog closes, focus should retain the user’s point of regard and return to the element that invoked it.
Uploaded file:
- Pressing Tab shifts focus to the “x” icon.
- Pressing Space or Enter while the “x” icon is in focus will delete the file.
Validation
When a specific file cannot be uploaded successfully it will show an error state. We have an option for a single-line or multi-line error state depending on how descriptive the message needs to be. Error messages should provide clear guidance to help the user resolve the error.