File upload

v1.0.0

File upload allows users to upload one or more files to a location.

  • Skin
  • Marko
  • React
Stylized artwork of a file upload pattern.

Considerations

Consistent

File upload ensures that users encounter the same interface and process whether they are uploading images, videos, or documents, promoting ease of use and reducing confusion across different parts of the system.

Compact

The design supports multiple file uploads and accommodates for properties like file name and description—all without overcrowding the interface or compromising usability.

Recognizable

File upload leverages the familiar visual cues commonly found in industry best practices and are widely recognized across various platforms and devices. The design helps users swiftly locate the upload area, creating a familiar and recognizable experience.

Anatomy

File input field

A diagram of the File input field with 4 elements: 1. Heading, 2. Description, 3. Select/Drop zone, 4. Complementary CTA.
  1. Heading
  2. Description
  3. Select/drop zone
  4. Complementary CTA

Add file button

A diagram of the Add file button in two sizes with 3 elements: 1. Heading, 2. Icon, 3. Background.
  1. Heading
  2. Icon
  3. Background

Preview card

A diagram of a file preview card with 5 elements: 1. Asset container, 2. Media indicator, 3. Icon button, 4. File name, 5. Counter.
  1. Asset container
  2. Media indicator
  3. Icon button
  4. File name (optional)
  5. Counter

List item

A diagram of a file list with 4 elements: 1. File name, 2. Asset container, 3. Loading spinner, 4. Icon button.
  1. File name
  2. Item container
  3. Loading spinner
  4. Icon button

Properties

Heading

On web, “Drag and drop files” is the required bolded heading to describe the user’s available action in the file upload container. This sets the correct expectation for interactions.

Example of a Drop zone button with header text “Drag and drop files”.

On native, the heading can be adjusted to be specific, for example “Add files” or “Add photos”.

Example of an Add file button with heading above it labeled “Add photos”.

Description

The description provides guidance on the acceptable formats and sizes for users. It can be modified to adapt to varying file upload requirements.

Example of a File input field with file guidelines.

Drag and drop

Drag and drop functionality is available on the web. When a user grabs a file and hovers over file input field, the cursor changes to a closed hand. Once the file is released into the file input field the cursor switches to a hand pointer.

Two examples of a File input field, first with a cursor hovering to drop a file, and the second with two files loading after being dropped.

Add file button

The add file button is used on native platforms instead of the file input field. The button is provided in a square and rectangle with label variants. The heading and description are placed above the gallery section. The add file button leads to the native camera roll, or presents a menu of multiple options, such as take photo or select photo.

Two examples of an Add button in a native app screen, one square and one rectangular.

File name

The file name is optional and can be included to help users distinguish between different files.

An example of File preview cards with file names placed under each photo.

Description

The item description is optional and may be provided to help users understand a document’s features or purpose.

An example of a File input field and File preview cards with file names and descriptions under each photo.

Media types

File types other than images are distinguished with the media type badge. Videos includes the play icon and time label. Other file types include a format abbreviation such as PDF, CSV etc.

An example of File preview cards with different media types identified including CSV, PDF, and video.

Behavior

Upload limits

When the file uploader allows multiple files to be uploaded, the file input or add file button remains visible while files upload and all uploaded files appear in a queue. If there is a limit to total files, the file input or file button will hide when the limit is reached. If files are removed so that the total is below the limit, the file input field or add file button will reappear.

An example of a File list showing three files with one in the loading state.

Progress states (gallery)

An example of a file gallery showing four files with two in the loading state.

An example of File preview cards showing four files with two in the loading state.

Progress states (list)

The loading spinner sets expectations for the user on how much longer the upload will take to complete.

An example of a File list showing two files in the loading state.

Validation

If a user selects a file that exceeds the specified size, an error message will appear above the selection/file input field. Users can only select files in the required format, which prevents errors related to file format.

Two example of uploaded files which displays error text above the Add button indicating issues with size limits and corrupted files. A Snack bar notification at the bottom shows a “retry” option.

Cancel uploading files

A user can cancel an ongoing file upload by clicking/tapping the button icon located in the corner of the file preview card.

An example of a File input field and a File preview card with the cancel button on the loading state.

Preview

The file preview is displayed in a bottom sheet or light-box modal that can be accessed from either the main page or the overflow modal (if there are multiple assets). This preview allows for viewing details and an enlarged format for all media types.

An example of a File gAn example of File preview cards next to an example of an image preview from the gallery.llery next to an example of an image preview from the gallery.
An example of  File preview cards next to an example of a video preview from the gallery.

Single action

If only a single action is available for an file preview card, such as delete, use an icon button for that specific feature.

An example of File preview cards with a delete icon button over the image.

Additional actions

If multiple actions are available for a file preview card, these options can be presented in a menu. This menu is accessible through an icon button. The delete action will remove the asset from the system.

An example of  File preview cards with an overflow icon button which opens a menu with options “Delete” and “Edit”.

File input width

The width of the file input field is responsive to the size of its parent container which varies per screen size.

Example File input fields in narrow and wide widths.

File preview card layout

File preview card have a responsive height and width to maintain a square ratio and fit their grid layout. All cards should be displayed at the same size. The parent container size will determine the file preview card widths, within the boundaries of 120px minimum and 396px maximum.

The responsive grid layout will allow cards to wrap to multiple rows as needed.

  • Breakpoint 320 - 2 columns
  • Breakpoint 512 - 4 columns
  • Breakpoint 768 - 5 columns
  • Breakpoint 1024 - 7 columns
  • Breakpoint 1280 - 9 columns
  • Breakpoint 1440 - 10 columns
Examples of File preview cards with size specifications.

Grid columns

The number of columns in the file preview card grid changes responsively based on the width of the parent container. The media container width will grow and shrink to fill the column space.

A detailed grid of screen size names and widths. There are 4 columns. From left to right reads “Small”, “Medium”, “Large”, and “X-Large”. Small has 320 Min “2 columns”, 360, 375 and 512 “4 columns”. Medium has 600, 768 “5 columns”, and 1024 “7 columns”. Large has 1280 “9 columns” and 1440 “10 columns”.  X-Large has 1640, 1680+ “12 columns”.

Screen sizes

Small

On small screens, only two file preview cards can be placed per row. If there are additional card beyond the second row, they can be accommodated using the overflow property.

After tapping the overflow, a panel will open that displays all the cards.

Two examples of File preview cards in the default and the expanded sheet view.

Medium and large

Depending on the width of the parent container, up to 6 file preview cards may fit per row. If there are more cards, they will wrap to a second row. The 6th card in the overflow utilizes the overflow property.

After clicking the overflow, the additional cards are displayed in a modal.

Example of a desktop web file upload showing file preview cards of shoes.
Example of desktop web file preview cards in he expanded dialog view.
Example of a desktop web file upload with multiple file list stacked.

Best practices

Description

Do truncate the asset description if it extends beyond two rows; the user can read the full description in the file preview.

A set of two file preview cards, each with two rows of file description text.

Don’t show more than two lines of description text at a time.

A set of two file preview cards, each with four rows of file description text.

Specs

File upload with File input field and File preview card components shown with paddings and spacing specs highlighted.
File upload with File input field and File preview card components shown with paddings and spacing specs highlighted.
File upload with File input field and File preview card components shown with paddings and spacing specs highlighted.
Min and max-width image containers. The Min is 120px and the Max is 396px.

Change log

VersionDateNotes
1.0
Mar, 2025
  • Accessibility guidance added
1.0
Dec, 2024
  • Created with eBay Evo
  • Initial release