File upload

v1.0.0

The file uploader allows users to upload one or more files to a location.

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

The file uploader 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

Drop zone button

A diagram of the Drop zone 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 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

Gallery item

A diagram of a file gallery 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 Drop zone button with file guidelines.

Drag and drop

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

Two examples of a Drop zone interaction, first with a cursor hovering to drop a file, and the second with two files loading after being dropped.

Add button

The add button is used on native platforms instead of the drop zone button. The button is provided in a square and rectangle with label variants. The heading and description are placed above the gallery section. The add 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 a File gallery 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 Drop zone and File gallery 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 a File gallery with different media types identified including CSV, PDF, and video.

Behavior

Upload limits

When the file uploader allows multiple files to be uploaded, the drop zone or add button remains visible while files upload and all uploaded files appear in a queue. If there is a limit to total files, the drop zone or add button will hide when the limit is reached. If files are removed so that the total is below the limit, the drop zone or add 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.

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/drop zone. Users can only select files in the required format, which prevents errors related to file format. If a file fails to upload because of connectivity issues, an error message will show below the asset container. For this use case, users can click a retry button to attempt the upload again.

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 asset container.

An example of a Drop zone and File gallery 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 gallery next to an example of an image preview from the gallery.
An example of a File gallery next to an example of a video preview from the gallery.

Single action

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

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

Additional actions

If multiple actions are available for an uploaded asset, 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 a File gallery with an overflow icon button which opens a menu with options “Delete” and “Edit”.

Select/drop zone width

The width of the select/drop zone is responsive to the size of its parent container which varies per screen size.

Example drop zones shown in narrow and wide widths.

Gallery layout

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

The responsive grid layout will allow asset containers 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 gallery images with size specifications.

Grid columns

The number of columns in the gallery view 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 asset containers can be placed per row. If there are additional assets beyond the second row, they can be accommodated using the overflow property.

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

Two examples of Image galleries in the default and the expanded sheet view.

Medium and large

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

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

Example of a desktop web file upload showing a gallery of shoes.
Example of a desktop web file gallery 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 gallery images, 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 gallery images, each with four rows of file description text.

Specs

File upload with Drop zone and File gallery components shown with paddings and spacing specs highlighted.
File upload with Drop zone and File list components shown with paddings and spacing specs highlighted.
File upload with Drop zone and File gallery 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.0
Dec, 2024
  • Created with eBay Evo