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
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-controlinscripts/check-markup.mjsfails an app's owninput, which includestype="file"(docs/audit.md). - Every input has a name people and screen readers get.
AGENTS.md, Accessibility: the title is visible, andinputLabelnames the file input itself ("Document file"). - Numbers roll, landings pop.
AGENTS.md, Motion: the percentage is the kit'sAnimatedNumber, 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
| Prop | What it takes |
|---|---|
onFiles | Gets the picked or dropped files; your code uploads them. |
accept, maxSize, multiple | Allowed types, the limit in bytes, more than one file. |
title, hint | What to send, and the types and limit in words. |
file | The upload's state: name, size, progress from 0 to 1, done; null for none. |
inputLabel | The file input's accessible name. |
disabled, className | While the form cannot take a file; your layout. |
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
| Manifest field | UploadDropzone |
|---|---|
| What it is | Drop or pick files, with progress per file. |
| Use it for | Every file input in a form or on a record. |
| Not for | For files dropped on a whole conversation (FileDropzone) |
| It replaces | A bare <input type=file>; A hand-built drop area |
| Screen types | Form; Record; Settings |
| Import | import { UploadDropzone } from "@meadowstack-studio/kit"; |
Where the example apps use it
| Example app | Modules that render it |
|---|---|
| An app for a haulage company | Costs |
| An app for a construction company | Drawings, Budget |
| An app for an accounting office | Documents |
How the demo calls it
<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")}
/>How the demo moves the upload along
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 });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.
Related
- A change order that shows its price before anyone approves itScreens
- A driver record that says what expires nextScreens
- A lot record that traces one step back and one step forwardScreens
- A packaging quote that works out its price as you typeScreens
- A site diary day, prefilled and signed by the right personScreens
- An invoice form that shows its totals as you typeScreens
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 frameworkHave 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