Skip to content
Components
/
File Upload
Dark

File Upload

File Upload lets people attach a file, and reports progress, success and failure along the way.

Preview

The surface that takes a file. Default invites the first tap. Bind State to the real request, never decorative: on iOS fileImporter, on Android GetContent.

File Upload, tap to run the cycle
340 x 180, radius 32, padding 24, 1px dash 5 on 3

Tap it. Default to Active to Uploading to Upload, the four states in order. Tap again to restart. Inside the box: a 24 icon, a 292 text column and, while uploading, a 292 by 4 track, stacked 12 apart with 4 between the two lines. Height is fixed at 180, so nothing moves as the state changes.

State

Six states, one 340 by 180 box. What changes: the fill, the edge, the icon and which of the two lines carries the message.

Default, Active, Uploading, Upload, Error, Disabled
one box, six skins
Tap to upload a filePNG, JPG, PDF · Up to 10 MB
Tap to upload a filePNG, JPG, PDF · Up to 10 MB
Tap to upload a filePNG, JPG, PDF · Up to 10 MB
file.pdfPNG, JPG, PDF · Up to 10 MB
file.pdfMessage for user
Tap to upload a filePNG, JPG, PDF · Up to 10 MB

In order: Default, white with a grey dash. Active, brand/lighter with a brand edge, press and drag-over. Uploading adds the track, filled to 191 of 292. Upload swaps the icon for the file type mark, filename on the primary line. Error recolours the edge, icon and supporting line, which carries the reason. Disabled has no edge. The four strings never change, only their colour. The dash is 5 on 3, an SVG rect: a CSS dashed border cannot set its pattern and Chrome draws roughly 3 on 3. The Upload mark is Adobe Acrobat in the file, a neutral tile here.

Properties

One axis and two text fields. No size, no layout, no boolean: the box is the same on every state.

Property
Type
Default
State
Default | Active | Uploading | Upload | Error | Disabled
Default
Label
Text
Tap to upload a file
Supporting Text
Text
PNG, JPG, PDF · Up to 10 MB
State
Fill
Edge
Leading and labels
Default
bg/white-0
border/sub-200
upload icon, primary in information blue
Active
brand/lighter
brand/base
the same, on a blue ground
Uploading
bg/white-0
border/sub-200
primary turns strong, a track appears
Upload
bg/white-0
border/sub-200
the file type mark, primary is the filename
Error
state/error/lighter-50
state/error/base-500
circle-alert, supporting carries the message
Disabled
bg/soft-100
none
everything on the disabled token

Disabled is the only state without an edge. It reads as a surface, not a target. Error is the only one that recolours the supporting line.

Tokens

Every value the component reads, resolved through its aliases to the Foundations primitive.

Token
Light
Dark
Applied to
bg/white-0
#FFFFFF
#0E0E0F
Default, Uploading, Upload
border/sub-200
#D1D1D6
#48484A
The dashed edge at rest
state/information/base-500
#155DFC
#155DFC
Upload icon and the inviting label, one mode
brand/base
#155DFC
#2B7FFF
Active edge and the progress fill
brand/lighter
#EFF6FF
#132150
Active fill
state/error/base-500
#FB2C36
#E7000B
Error edge, icon and message
state/error/lighter-50
#FEF2F2
red 16%
Error fill, an alpha in dark
bg/soft-100
#E9E9EA
#48484A
Disabled fill and the progress track
text/strong-950
#0E0E0F
#FFFFFF
Primary label once there is a file
text/sub-700
#48484A
#C7C7CC
Supporting line
text/disabled-400
#AEAEB2
#8E8E93
Everything on Disabled, with fg/disabled-400

state/information/base-500 aliases colors/blue/500 in both modes, so it does not lift in dark the way brand/base does. A dark Active card carries a #2B7FFF edge around a #155DFC label. The label is the half you have to read. Geometry runs on dimensions/radius/3xl 32, dimensions/spacing/6 24, dimensions/spacing/3 12 and dimensions/border/1.

Guidelines

Do
report.pdfToo large. The limit is 10 MB.

Put the reason on the supporting line. The state has a place for the message, so use it instead of a toast that leaves.

Don't
Tap to upload a file 

Do not leave the supporting line empty. What you accept and how big it can be is the one thing the user needs before they choose.

Uploading, Upload and Error are answers from the server. Wire State to the real request: a card that says Uploading while nothing is in flight is worse than no state at all.