Select your language
Select other languages

Automatic translation

Loading translator…

Magoomake your components work correctlyBack to homepage

File upload

Allows selecting, uploading, and managing files with clear limits, states, and failure recovery.

For working examples and design patterns for this component, see the references tab (opens the references on this page).

COMPONENT GUIDE

Explore behaviors before defining the interface.

Quick guide for designers

When to use

Use when a task requires attaching files. Distinguish choosing a file from uploading it to the system.

What to design

Show allowed formats, size, and count, the file list, progress, success, errors, removal, and retry.

How it behaves

Selection opens the system file picker. Dragging is an alternative; upload may be immediate or require an explicit action.

What to document in Figma

Define upload initiation, limits, duplicate files, cancellation, removal, and what is preserved after failures.

How to review

Check states in the design. In the implementation, verify selection, upload, and recovery with keyboards, touch, and screen readers.

Before interaction

Selection and upload

Errors and recovery

Interaction Methods

Mouse and touch

Activating Select files opens the native picker. Drag and drop, when available, runs the same checks as selection.

Clicking or tapping Remove removes the file from the list; Cancel upload stops its transfer; Retry repeats the failed upload when these actions are available.

Keyboard

Tab and Shift + Tab traverse the field and file controls. Enter or Space on Select files opens the native picker; choosing and canceling within it follow the platform.

After choosing a file, Tab reaches Upload when submission is explicit. Enter or Space activates Upload, Remove, Cancel upload, or Retry on the focused button.

Screen readers

When navigating the field and files with a screen reader, people identify the label, restrictions, and each file’s name and state. Activating Select files opens the platform picker.

With a mobile screen reader, swiping traverses controls in the standard navigation mode and double tapping activates the focused control. Uploading or removing gives corresponding feedback.

Gherkin

BDD (Behavior-Driven Development) methodology focusing on three pillars: User Stories, Acceptance Criteria, and Gherkin Syntax (Given, When, Then).

Scenario: Given that I am on a page containing File upload

Educational scenarios for reviewing behavior. Adapt them to context and execute them in the implementation; the presence of this text does not mean tests were performed.

Keyboard navigation

Screen reader on desktop

Screen reader on mobile devices

Additional scenarios — editorial extension

Add without dragging

Reject one file

Retry and removal

Review with a mobile screen reader

Points to consider

The accept attribute helps filter the picker but does not replace server-side file validation. Size, count, and contents also require implementation checks.

Do not promise resumable upload or file preservation after reload without actual support. Document recovery limits.

USWDS File input is a reference for file selection; the asynchronous upload flow described here is an editorial adaptation requiring its own implementation.

Implementation notes and behavior decisions

Remove, Cancel upload, and Retry are distinct controls when those actions exist.

Tab and Shift + Tab traverse the field and each file control. Picker activation follows the native control and platform commands.

The gesture of dragging cannot be the only way to add files. Focus order follows the displayed list.

Associate the label, restrictions, and errors with the field. Identify the file in repeated action names, such as Remove receipt.pdf.

Communicate upload start, completion, and failure without moving focus for every update. A progress indicator must identify its operation.

References

Additional references for components of type File upload.

Important:
Most references are on the course platform alongside the lessons cited in this material.

Disclaimer:
The links listed here are a curated collection of references where you can find implemented components, rather than recommendations. There is no unified implementation format and no guarantee that these links follow every design pattern. Direct questions to the teams responsible for the linked materials. Before copying a model, remember that all materials are constantly updated and that patterns, particularly proprietary ones, may change.

Technical references and examples consulted for this editorial adaptation. Each source retains its scope; consulting an example does not prove accessibility of another implementation.

USWDS — File input (external link, opens in a new tab)

MDN — input type="file" (external link, opens in a new tab)

Original content by Marcelo Sales, initially used in the AccessBoost course (external link - opens in a new window). These interactions represent standard industry patterns, but may be customized in specific cases, provided there are sufficient instructions for people to understand the behavioral change.