Progress
Task completion as a bar or circle from 0 to 100, or an indeterminate bar when the percent is not known.
A drop zone with a Choose files button and a list of file rows with their progress.
A Choose files Button in a dashed drop zone, or on its own in the compact variant, plus file rows with progress, done, and error. Presentational: the app does the upload and passes the state back. Rows compose kit Progress and Button. Not Dropzone or FileInput.
Pick or drop files. A timer fakes progress here; there is no network. The error row retries.
onFilesSelected hands you File objects; start the upload, then feed progress, status, and errors back through files. Choose files is a kit Button, so Tab and Enter open the picker. Drag and drop is an extra. Put the limits in maxSizeLabel so people see them before they pick.
Choose files Button in a dashed drop zone (or a compact Button-only row) plus a list of file rows with progress, done, and error states. Presentational: the app does the upload; FileUpload reports picked files and renders the state it is given.
import { FileUpload } from "agentic-ds-kit";From contracts/fileupload.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.
| Name | Type | Required | Default | Notes |
|---|---|---|---|---|
| onFilesSelected | function | Yes | — | (files: File[]) => void. Called after a pick or a drop. Dropped files are filtered by accept; multiple=false keeps the first. |
| variant | zone | compact | No | zone | zone is the dashed drop area with a neutral sm Choose files Button, 'or drag and drop' and the limits line. compact is the Button and the limits line on one row, for drawers and tight forms. Both accept dropped files. |
| files | array | No | [] | { id, name, size (bytes), progress? (0 to 100), status: 'uploading' | 'done' | 'error', error? }[]. Rows render in this order. |
| onRemove | function | No | — | (id) => void. When set, every row shows a remove Button (X while uploading, Trash2 after). |
| onRetry | function | No | — | (id) => void. When set, error rows show a labelled sm Retry Button. |
| accept | string | No | — | Same as the input accept attribute: extensions (.pdf) and MIME types (image/*). |
| multiple | boolean | No | true | — |
| maxSizeLabel | string | No | — | Limits line beside or under the Choose files Button, e.g. 'PDF or PNG, max 10 MB, up to 5 files'. Show it up front. Text only; the app enforces limits and reports them as row errors. |
| disabled | boolean | No | false | — |
| id | string | No | — | Choose files Button id. Inside Field, pass the same value as htmlFor. |
| describedBy | string | No | — | Set by Field (hint or error id). |
| error | boolean | No | false | Set by Field when it has an error. Danger border on the zone, like Input. Field's error text carries the message. |