A shadcn-style file upload component built with Ark UI primitives.

Try a large file to see rejectedFiles

    Installation

    npx shadcn@latest add @ark-cn/file-upload

    Usage

    import * as FileUpload from "@/components/ui/file-upload"

    Read exported parts in src/components/ui/file-upload.tsx and compose the primitive according to the Ark UI pattern for this component.

    Examples

    Avatar Circle

    Tap or drop image

    Add your avatar

    PNG, JPG up to 2MB

    Avatar Soft

    Square-ish drop target
      Try a large file to see rejectedFiles

        Image Preview + PDF Icon

        Upload images or PDF files

          Accepted Files

          PNG, JPG, WEBP, and PDF

            Dropzone

            Drag and drop files hereor click to browse

              Clear Trigger

                Directory Upload

                  Pasting Files

                    Rejected

                    Try a large file to see rejectedFiles

                      Root Provider

                      0 accepted · dragging: no

                        With Field

                        Max 2 files, 2KB each (invalid Field wrapper for demo)
                          Attach at least one document to continue.

                          API reference

                          This component mirrors the upstream Ark UI primitive. All props and DOM behavior are defined by Ark unless you see an ark-cn-only row below.

                          FileUploadItemDeleteTrigger

                          PropTypeDescription
                          variant?ButtonVariantButton style for the delete control (default ghost).
                          size?ButtonSizeButton size for the delete control (default icon-xs).

                          See the ARK UI documentation for the full API.