Upload Wait

Lets people submit a form while attachments are still uploading: it queues the send, shows progress and submits when uploads finish.

StopsForm submitted before upload finished

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/upload-wait.json

The files land in your project. They're yours to edit.

What it catches

  • Submitting before attachments have uploaded (queued instead)
  • Failed uploads, which pause the send until retried
  • Leaving the page mid-upload
  • Cancelling the queued send

Props

UploadWait props
PropTypeDefault
uploads* (required)

Every upload attached to this form, with its live status.

UploadItem[]—
onSubmit* (required)

Runs once every upload is done. Gets the form's data as it is at that moment. Return a promise for a pending state.

(data: FormData) => void | Promise<void>—
onRetry* (required)

Retries a failed upload.

(id: string) => void—
submitLabel

Label of the submit button.

string"Submit"
waitingLabel

`{count}` is "2 uploads".

string"Waiting for {count}…"
failedLabel

Label when an upload failed.

string"{count} failed"
submittingLabel

Label while onSubmit runs.

string"Sending…"
sentLabel

Label after sending.

string"Sent"
cancelLabel

Label of the cancel-queued-send button.

string"Don't send yet"
retryLabel

Label prefix of each retry button.

string"Retry"
idleHint

Hint while uploads run and nothing is queued. `{count}` and `{submit}` are filled in.

string"{count} still uploading. You can press {submit} now; it …
queuedHint

Hint while the send is queued.

string"Sends automatically when they finish."
failedHint

Hint when an upload failed.

string"Retry the failed upload to send."
listLabel

Accessible name of the upload list.

string"Uploads"
uploadedLabel

Accessible label of the done tick.

string"Uploaded"

* required. Also accepts the native props of <form> (className, aria-*, data-*…), passed through to it.

Accessibility

  • Uploads list has an aria-label; retry buttons name the file
  • Status in a polite live region
  • Submit uses aria-busy while waiting or sending and aria-disabled once sent
  • Focus moves to Retry when an upload fails

Only what the source does. Test with your own screen reader and content before shipping.

Limitations

This is a UX guard rail. Enforce on the server: Validate on the server that every referenced upload exists and finished before accepting the form.

  • Upload state comes from your uploads prop
  • The server must still reject submissions that reference missing files

What it stops

Form submitted before upload finished

Also known as

upload progress · file upload · submit button · waiting for upload · s3 upload · document upload · kyc docs

Field type

Dependencies

Pairs well with