File Upload

Two file upload patterns: an attachment workspace for mixed files, links, audio and media, plus a progress queue with retry and removal.

Attachment Upload

attachment-upload.tsx

A mixed attachment workspace with a dropzone, staggered file and image rows, animated upload, success, failure, retry and removal feedback, shared-layout image previews, and an audio waveform.

Attachments:

  • launch-brief.pdfUpload failed31 MB
  • orange-flowers.jpg9.3 MB
  • 0:120:48

Install

$ bunx --bun shadcn add @beui/attachment-upload

API Reference

value?
{}
defaultValue?
{}
onValueChange?
((items: {}) => void)
onFilesAdded?
((items: {}, files: {}) => void)
onFilesRejected?
((files: {}, reason: AttachmentRejectReason) => void)
onRemove?
((item: AttachmentUploadItem) => void)
onRetry?
((item: AttachmentUploadItem) => void)
playingId?
string
onAudioToggle?
((item: AttachmentUploadItem) => void)
accept?
string
multiple?
boolean
true
maxFiles?
number
12
maxFileSize?
number
500 * 1024 * 1024
disabled?
boolean
false
title?
string
Drag and drop or browse files
description?
string
attachmentsLabel?
string
Attachments
className?
string
classNames?
AttachmentUploadClassNames

Upload Queue

file-upload.tsx

A drag-and-drop upload queue with progress rows, upload states, retry, and removal.

Upload package

1 of 3 files ready

  • brand-assets.zip

    ZIP · 18 MB

    Uploaded
  • release-cut.mov

    MOV · 80 MB

    Uploading
  • vendor-contract.pdf

    PDF · 2.7 MB · Connection lost

    Failed

Install

$ bunx --bun shadcn add @beui/file-upload

API Reference

value?
{}
defaultValue?
{}
onValueChange?
((items: {}) => void)
onFilesAdded?
((items: {}, files: {}) => void)
onRemove?
((item: FileUploadItem) => void)
onRetry?
((item: FileUploadItem) => void)
accept?
string
multiple?
boolean
true
maxFiles?
number
disabled?
boolean
false
variant?
"default" | "centered"
default
title?
string
Drop files here
description?
string
Add files to the upload queue
browseLabel?
string
Browse
className?
string
classNames?
FileUploadClassNames

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.

Updated