Skip to content
Storybook

File upload

Drag-and-drop area with click-to-browse, plus a queue of files with progress.

Preview

React · live from the Storybook

HTML and CSS

The same component as plain HTML with pixels-ui.css, no framework needed.

Click to upload or drag and drop SVG, PNG, JPG or GIF (max. 800×400px)
PDF
Brand guidelines.pdf720 KB
100%

Usage

  • Say the allowed types and size before upload.
  • Show errors on the file row with a way to remove it.

Installation

Included in the core files. No extra install.

HTML
<link rel="stylesheet" href="/css/pixels-tokens.css">
<link rel="stylesheet" href="/css/pixels-ui.css">
<script src="/js/pixels-ui.js" defer></script>

Examples

Error item

MP4
Product demo.mp4Upload failed. File is over 50 MB.

API reference

Class / attributeTypeDescription
data-px-dropzone="listId"attributeMakes the area interactive and adds files to #listId.
px-file · px-file--errorclassQueue item and error state.

Figma properties

File upload / Dropzone8 variants · page “File Upload”Open

Drag-and-drop area with a click-to-browse fallback. Hover is also the drag-over state. Wrap a visually hidden <input type="file">; announce added files with aria-live.

PropertyTypeValues
HintText“SVG, PNG, JPG or GIF (max. 800×400px)”
StateVariantActive Hover Focused Disabled
DirectionVariantLTR RTL
File upload / Item6 variants · page “File Upload”Open

A file in the upload queue: progress while uploading, check when complete, error message with remove action on failure.

PropertyTypeValues
StateVariantUploading Complete Error
DirectionVariantLTR RTL

Design tokens

Component tokens from the Figma Component collection. Override them to restyle just this component.

TokenAliasLight value
--px-file-upload-iconcolor-content-neutral-secondary#475467
--px-file-upload-radiusradius-1616px
--px-file-upload-paddingspacing-2424px
--px-file-upload-padding-yspacing-3232px

Accessibility

  • The zone is a button: Enter/Space opens the file dialog.
  • Announce added files with aria-live.