Inputs · FileUploadstable
File upload
Adds files by dragging them in or browsing. Each file shows its progress, then a success or error state; the hint states accepted types and the size limit. Square, flat and token-driven.
Preview
#previewSwitch single or multiple, validation and state. The React and CSS tabs update with the preview.
Upload statements or invoices, up to 5 files.
- bank-statement-oct.pdfUploaded · 2.4 MB
- invoice-sep-2026.pdf1.2 of 2.4 MB · 50%
multiple · accept .pdf,.csv · up to 10 MB
statement-upload.tsx
import { FileUpload } from "@blade-ai/weft/components/file-upload";
export function StatementUpload({ files, upload, remove, retry }: Props) {
return (
<FileUpload
label="Supporting documents"
accept=".pdf,.csv"
maxSize={10 * 1024 * 1024}
files={files}
onFilesAdded={upload}
onRemove={remove}
onRetry={retry}
helpText="Upload statements or invoices, up to 5 files."
isMultiple
maxFiles={5}
/>
);
}All states
#all-statesDropzone and file row states from the File Upload sheet, shown at 440px wide.
Upload this month’s statement to verify your account.
Idle
Upload this month’s statement to verify your account.
Hover
Upload this month’s statement to verify your account.
Focus-visible
Upload this month’s statement to verify your account.
Drag-over · valid
Upload this month’s statement to verify your account.
Drag-over · invalid type
Upload this month’s statement to verify your account.
Disabled
bank-statement.docx isn’t a supported file type.
Error · invalid
Upload this month’s statement to verify your account.
- bank-statement-oct.pdf2.4 MB · Waiting to upload
Queued
Upload this month’s statement to verify your account.
- bank-statement-oct.pdf1.2 of 2.4 MB · 50%
Uploading
- bank-statement-oct.pdfUploaded · 2.4 MB
Upload this month’s statement to verify your account.
Success (single)
Upload this month’s statement to verify your account.
- bank-statement-oct.pdfUpload failed · connection lost
Error + retry
Upload this month’s statement to verify your account.
- bank-statement-oct.pdfRemoving…
Removing
Upload this month’s statement to verify your account.
- hdfc-bank-statement-01-apr-to-30-sep-2026-final.csvUploaded · 3.8 MB
Long filename · CSV
Props
#propsBooleans are is-prefixed. label is required. Sizes are in bytes; rows are controlled through files.
Prop
Type
Default
Description
label *
string
—
Field label.
labelPosition
"top" | "left"
"top"
Label above or to the left.
accept
string
—
Allowed extensions, e.g. ".pdf,.csv". Drives the hint and on-drop validation. Default: any type.
maxSize
number
—
Max size per file in bytes; shown in MB in the hint. Default: no limit.
maxFiles
number
—
Max number of files when isMultiple. Default: UNDEFINED · needs decision (no limit for now).
isMultiple
boolean
false
One file or several.
files
UploadFile[]
Controlled list, one row each: { id, name, size, type, status, progress (0–100), errorText }. status: queued · uploading · success · error · removing.
onFilesAdded
(files: File[]) => void
—
Called with the files that passed client-side validation, on drop or pick.
onFilesRejected
(rejections: { file, reason }[]) => void
—
Called with rejected files and a reason: tooLarge · wrongType · tooMany · duplicate. Duplicate detection key and outcome: UNDEFINED · needs decision (not emitted).
onRemove
(id: string) => void
—
Remove an uploaded file, or cancel one that is queued or uploading.
onRetry
(id: string) => void
—
Retry a failed upload (network or server errors only).
helpText · errorText
ReactNode
—
Guidance or field-level error under the drop zone.
isInvalid
boolean
false
Shows errorText and the invalid border.
isRequired
boolean
false
Marks the field as required.
isDisabled
boolean
false
Disables the drop zone and every file action.
name · accessibilityLabel · testID
string
—
Form field name on the hidden file input · accessible name override · test selector.
Usage
#usageShort rules for upload fields.
Do
State types and size in the hint before a file is picked.
Keep the Pattern layer under all content and inside the surface padding.
Name the file in every error and announcement.
Replace the zone with the row for single uploads.
Don't
Don't place content over the pattern without the surface padding.
Don't raise the wash above lime/100 at rest; it must never compete with the copy.
Don't show Retry for size or type errors.
Don't show MIME types, bytes or server codes.
Accessibility
#accessibilityA native button opens a hidden file input; each file is a list item.
Keyboard
Key
Action
Tab
Dropzone (button) → each file row: Retry → Remove / Cancel.
Enter / Space on the dropzone
Opens the native picker.
Enter / Space on Retry / Remove
Acts on that file.
After remove
Focus moves to the next row, else the previous, else the dropzone.
Disabled
Dropzone and actions are skipped (not focusable).
Focus ring
:focus-visible only, interactive.border.primary.faded 3px.
ARIA
Element
Role / attribute
When
Dropzone
<button> aria-describedby="hint help error" · aria-labelledby = label + zone text
Always
Hidden input
<input type="file" accept multiple hidden> + <label for>
Always
Dropzone
aria-invalid="true" · error id in describedby
Invalid
Live region
<div role="status" aria-live="polite">: "x added" · "x uploaded" · "x failed: reason" · "2 files weren't added"
Files change
ProgressBar
role="progressbar" aria-valuenow aria-valuemin=0 aria-valuemax=100 aria-label=file name
Queued / uploading
Actions
aria-label="Remove | Cancel upload of | Retry {file}"
Each row
Pattern + icons
aria-hidden="true"
Always
Dropzone
aria-disabled="true"
isDisabled
Agent Spec
#agent-specMachine-readable spec, tables (a)–(g). Same source as /specs/file-upload.json and llms.txt.
PropertyValueToken
Dropzonewidth fill (440 in forms) · padding 24 · gap 8 · 1px dashed borderspacing.7 · spacing.3 · border.width.thin
Icon badge · icon36 square · 16size.36 · size.16
Pattern1px dots on a 3px pitchinteractive.background.gray.faded (literal pitch)
Brand wash135° linear, subtle → transparent at 70%; drag-over uses primary.intensesurface.background.primary.subtle · intense
FileRowpadding 12 · gap 12 · 1px inset border · list gap 8spacing.4 · spacing.3
ProgressBarheight 4 · square endssize.4
Remove · Retry28 icon button · text linksize.28
Radius0border.radius.none