文件上传

支持拖拽上传的队列组件,带进度行、重试/移除操作,状态切换对「减少动效」偏好友好。

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
  • 安装

    用 shadcn CLI 添加,或手动复制源码。

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

    API 参考

    value?
    FileUploadItem[]
    defaultValue?
    FileUploadItem[]
    onValueChange?
    ((items: FileUploadItem[]) => void)
    onFilesAdded?
    ((items: FileUploadItem[], files: File[]) => 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.