File Upload

Specs: Based on DESIGN.md form patterns (line 444-458)

Default

upload_file
Drag and drop files here
or click to browse
<div class="elv-file-upload">
  <div class="elv-file-upload__zone" id="drop-zone">
    <span class="elv-file-upload__icon material-symbols-outlined">upload_file</span>
    <div class="elv-file-upload__text">
      <div class="elv-file-upload__primary">Drag and drop files here</div>
      <div class="elv-file-upload__secondary">or click to browse</div>
    </div>
    <button type="button" class="elv-file-upload__button">Browse files</button>
    <input type="file" class="elv-file-upload__input" multiple />
  </div>
  <div class="elv-file-upload__files" id="file-list"></div>
</div>

Single File Upload

upload_file
Drag and drop your image here
or click to browse

Accepted formats: JPG, PNG, GIF (max 5MB)

<label class="elv-input-label">
  Upload Profile Picture <span class="elv-required">*</span>
</label>
<div class="elv-file-upload">
  <div class="elv-file-upload__zone">
    <!-- ... -->
    <input type="file" accept="image/*" required />
  </div>
</div>
<p class="elv-input-helper">Accepted formats: JPG, PNG, GIF (max 5MB)</p>

With File Type Restrictions

description
Drag and drop documents here
PDF, DOC, DOCX only

Maximum 10MB per file

<input
  type="file"
  accept=".pdf,.doc,.docx"
  multiple
/>

Compact Variant

attach_file
Drop files or click to browse
<div class="elv-file-upload elv-file-upload--compact">
  <!-- Smaller height, no button -->
</div>

States

upload_file
Drag and drop files here
or click to browse
upload_file
File upload disabled
Complete previous steps first
upload_file
Drag and drop files here
or click to browse
description
Annual_Report_2024.pdf
2.4 MB
image
Company_Logo.png
512 KB
error
Large_Video.mp4
File too large (25 MB)
<!-- Error State -->
<div class="elv-file-upload__zone elv-file-upload__zone--error">
  <!-- ... -->
</div>
<p class="elv-input-error" role="alert">Error message</p>

<!-- Disabled State -->
<div class="elv-file-upload__zone elv-file-upload__zone--disabled">
  <input type="file" disabled />
</div>

<!-- File List Item -->
<div class="elv-file-upload__file">
  <span class="material-symbols-outlined">description</span>
  <div class="elv-file-upload__file-info">
    <div class="elv-file-upload__file-name">filename.pdf</div>
    <div class="elv-file-upload__file-size">2.4 MB</div>
  </div>
  <button class="elv-file-upload__file-remove material-symbols-outlined">close</button>
</div>

<!-- File Error -->
<div class="elv-file-upload__file elv-file-upload__file--error">
  <!-- ... -->
</div>

Accessibility Notes

Design System Specs

Property Value Token
Background #f2f2f3 N10
Border (default) 2px dashed #dfdfe2 border-light
Border Radius 12px radius-md
Min Height (default) 160px
Min Height (compact) 80px
Padding 32px space-8
Hover Background #fafafa N5
Hover Border #b0afb6 N40
Dragover Background #ebe9f6 P20
Dragover Border 2px solid #5746b2 P100
Focus Outline 2px solid #5746b2 P100
Error Background #fff6f5 R20
Error Border 2px solid #eb2000 R120
Icon Color #6f6d78 text-nonessential
Primary Text 16px / 600 Body weight 600
Secondary Text 14px / 400 #6f6d78 Label Sm
File Item Padding 12px space-3