File Upload

Attachment Upload

attachment-upload.tsx

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?
AttachmentUploadItem[]
Default—
defaultValue?
AttachmentUploadItem[]
Default—
onValueChange?
((items: AttachmentUploadItem[]) => void)
Default—
onFilesAdded?
((items: AttachmentUploadItem[], files: File[]) => void)
Default—
onFilesRejected?
((files: File[], reason: AttachmentRejectReason) => void)
Default—
onRemove?
((item: AttachmentUploadItem) => void)
Default—
onRetry?
((item: AttachmentUploadItem) => void)
Default—
playingId?
string
Default—
onAudioToggle?
((item: AttachmentUploadItem) => void)
Default—
accept?
string
Default—
multiple?
boolean
Defaulttrue
maxFiles?
number
Default12
maxFileSize?
number
Default500 * 1024 * 1024
disabled?
boolean
Defaultfalse
title?
string
DefaultDrag and drop or browse files
description?
string
Default—
attachmentsLabel?
string
DefaultAttachments
className?
string
Default—
classNames?
AttachmentUploadClassNames
Default—

Upload Queue

file-upload.tsx

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?
FileUploadItem[]
Default—
defaultValue?
FileUploadItem[]
Default—
onValueChange?
((items: FileUploadItem[]) => void)
Default—
onFilesAdded?
((items: FileUploadItem[], files: File[]) => void)
Default—
onRemove?
((item: FileUploadItem) => void)
Default—
onRetry?
((item: FileUploadItem) => void)
Default—
accept?
string
Default—
multiple?
boolean
Defaulttrue
maxFiles?
number
Default—
disabled?
boolean
Defaultfalse
variant?
"default" | "centered"
Defaultdefault
title?
string
DefaultDrop files here
description?
string
DefaultAdd files to the upload queue
browseLabel?
string
DefaultBrowse
className?
string
Default—
classNames?
FileUploadClassNames
Default—

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