Skip to content

    Browse components

    File Drop

    An upload zone that wakes up under a dragged file: the dashed edge marches, the icon lifts, and dropped files slide into a list with their own progress bars that finish with a check.

    Open
    Customize

    Installation

    npx shadcn@latest add @glint-ui/file-drop

    First time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glintui.vercel.app/r/file-drop.json

    Usage

    import { FileDrop } from "@/components/ui/file-drop";
    
    <FileDrop
      accept="image/*"
      upload={(file, onProgress) => uploadToStorage(file, onProgress)}
    />

    Props

    PropTypeDefaultDescription
    titlestring"Drop files here"Main line in the zone.
    hintstring"or click to browse"Second line in the zone.
    multiplebooleantrueAllow more than one file.
    acceptReactNode—File types for the picker, e.g. "image/*,.pdf".
    uploadReactNode—(file, onProgress) => Promise<void>. Report progress 0 to 1.
    onFilesReactNode—(files) => void, called with the files added.
    classNamestring—Extra classes for the root element.