Skip to content
HomeCobalt

File drop

Takes files from a drag or from the device's picker, and shows each one's upload as it goes, so a person knows which files arrived, which are still on their way, and which failed and why.

Examples

Documents for a booking, each showing its upload and its result, with Retry when one fails.

Drop files here, or

PDF, CSV or an image, up to 10 MB each

  • Rental agreement, Harbour suite.pdfUploaded1.8 MB
  • PDFDeposit invoice BK-48215.pdfUploading
  • Group rooming list.csvThe connection dropped at 60%.
One fileA CSV of funds to import into a research list, with the button worded for one file.

Fund list

Drop files here, or

A CSV with one fund per row, up to 5 MB

The first row names the columns: fund, adviser, gross assets.

A file that is too largeA photo past 200 KB is refused when picked or dropped, and the reason stays under the area until the next pick.

Logo on invoices

Drop files here, or

A PNG or SVG, up to 200 KB

States

Drop files here, or

Documents close when the guest checks out

  • Final invoice BK-48201.pdfUploaded268 KB
DisabledThe booking is checked out, so its documents stay listed and no file can be added or removed.

Drop files here, or

PDF, CSV or an image, up to 10 MB each

  • Rental agreement, Harbour suite.pdfUploaded1.8 MB
A file dragged over the areaThe area while a file is dragged over it, held here by `dragging` so it shows without a drag: the edge takes the accent, the fill its soft tint, and nothing moves. A host passes `dragging` while a file is anywhere over the window.

Usage

Use it when

  • A booking's documents, a contract, an import: files that go to a server and take a moment each.
  • A person may add several files and needs to see which arrived.

Use something else when

  • A single avatar, logo or cover, placed before it is saved. Use ImageField instead, which crops and uploads one picture in place.
  • Text a person could paste, such as a list of tickers. Use Textarea instead.

Rules

General

Content

Avoid

Limits

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/file-drop.json
import { FileDrop, accepts, fileDropLabels, type DropFile } from "@/components/cobalt/ui/file-drop"