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.
Installation
npx shadcn@latest add @glint-ui/file-dropFirst 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
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | "Drop files here" | Main line in the zone. |
| hint | string | "or click to browse" | Second line in the zone. |
| multiple | boolean | true | Allow more than one file. |
| accept | ReactNode | — | File types for the picker, e.g. "image/*,.pdf". |
| upload | ReactNode | — | (file, onProgress) => Promise<void>. Report progress 0 to 1. |
| onFiles | ReactNode | — | (files) => void, called with the files added. |
| className | string | — | Extra classes for the root element. |