Skip to content

Components

UploadDropzone: drop or pick a file

UploadDropzone is the file input of every form and record in an app built on Meadowstack: one box that takes a dropped file or opens the picker. It answers while a file is dragged over it, refuses a file that is too big on the spot, and shows the upload inside itself until it lands.

By Bohuslav PoláčekChecked

Kestrel's client portal in the demo, where a client sends the receipt the office is missing: no file yet, on its way at 35%, uploaded. The file's name and size are an example.

What it is for

Wherever a form or a record takes a file, an app built on Meadowstack shows the same box: a title that says what to send, a hint with the types and the limit, and room to drop the file or click for the picker. The whole box is one button, so it is a large target on a phone, where the hint in the demo says "A phone photo or a PDF".

The preview follows one upload on the client portal of the Kestrel example, where a client sends the receipt the office is missing. Before a file, the box waits. While the request runs, it shows the file's name and size, a percentage that rolls and a bar under them. When the request returns, the word uploaded lands with a check. In the running app the box also answers while a file is dragged over it, and refuses a file over the limit before anything is sent.

The manifest says when: every file input in a form or on a record. Files dropped anywhere on a whole conversation, like a chat, are FileDropzone's job.

The rules and where they live

  • File inputs are UploadDropzone. The root AGENTS.md, Lightness, in the list of things that always come from the kit.
  • A drop box that answers before the file is let go, refuses a file that is too big on the spot and shows the upload in itself. docs/patterns.md, Files and photos, where the Stonebridge budget import is the place to try it.
  • No own input in an app. The static guard bare-control in scripts/check-markup.mjs fails an app's own input, which includes type="file" (docs/audit.md).
  • Every input has a name people and screen readers get. AGENTS.md, Accessibility: the title is visible, and inputLabel names the file input itself ("Document file").
  • Numbers roll, landings pop. AGENTS.md, Motion: the percentage is the kit's AnimatedNumber, the check lands on the kit's curve, and reduced motion keeps fades only.
  • External roles see only their own records. AGENTS.md, Permissions and audit: the portal lists and takes only the client's own documents, which is why the box names the one that is missing.

What AI coding tools write instead

The manifest names a bare <input type=file> and a hand-built drop area. The bare input looks different in every browser, has no room for a hint, and says nothing about the upload once a file is chosen. The hand-built drop area usually works only with a mouse, checks the size after the whole file has gone to the server, shows a spinner with no progress, and forgets the file's name the moment it lands, so nobody can tell which receipt went.

UploadDropzone keeps one shape for all of it: accept and maxSize are checked in the browser before the upload starts, the file's state comes back in through file, and the box is a real button that Tab reaches and Enter opens.

How to use it

The api does the upload and checks the person's permissions; set file while it runs and when it returns, as the demo's portal does.

Its entry in the manifest

The component's rules as the kit's manifest states them, the same entry an AI coding tool reads.Read from the kit's component manifest when the site was built (126 components, packages/kit/src/components.json); the same entry answers an AI coding tool through the kit's MCP server.

Where the example apps use it

The example apps and modules that render UploadDropzone, read from the demo's code when the site builds.Read from the demo's source when the site was built: 3 of 9 example apps render <UploadDropzone>, in the modules named here as each app's sidebar names them.

How the demo calls it

apps/demo/src/modules/documents/components/client-portal.tsx
<UploadDropzone
  onFiles={(files) => void upload(files)}
  accept="image/*,.pdf"
  maxSize={MAX_SIZE}
  file={file}
  title={tx(`Nahrajte doklad: ${line.counterparty}`, `Upload the document: ${line.counterparty}`)}
  hint={tx("Fotka z telefonu nebo PDF, do 20 MB", "A phone photo or a PDF, up to 20 MB")}
  inputLabel={tx("Soubor dokladu", "Document file")}
/>
The client portal's box: images and PDFs up to the portal's limit, a title that names whose document is missing, and the upload's state passed back in as file.

How the demo moves the upload along

apps/demo/src/modules/documents/components/client-portal.tsx
const upload = async (files: File[]) => {
  const picked = files[0];
  if (!picked || !line) return;
  setFile({ name: picked.name, size: picked.size, progress: 0.35 });
  try {
    await uploadDocument(company.slug, line.id, picked.name, person);
    setFile({ name: picked.name, size: picked.size, progress: 1, done: true });
The portal sets the file to 35% while the request runs and to done when it returns; the box draws both.

Questions

What happens when a file is too big?

The box refuses it on the spot, before anything is sent. The limit is the maxSize you pass, 20 MB on the demo's client portal, and the hint under the title says it in words.

Can people use it without a mouse?

Yes. The whole box is one button: Tab reaches it, Enter or Space opens the file picker, and dropping a file is only the faster way.

How is it different from FileDropzone?

UploadDropzone is a box in a form or on a record. FileDropzone takes files dropped anywhere on a whole conversation, like a chat.

Does the component upload the file itself?

No. It hands the files to your code and draws the state you pass back, so the app's api does the upload and checks who may send what.

Two ways

Build it yourself, or have it built

  • Build it yourself

    Build your app on the framework

    Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.

    One payment, lifetime updates

    Get the framework
  • Have it built

    Have us build your app

    Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.

    After launch, Care keeps it improving, from €99 a month.

    from €1,990

    Describe your app