Dropzone
A field that takes a file dropped on it or picked from the file dialog, and shows what was chosen as a preview that a click removes.
Usage
Examples
Sizes
size sets the drop area and the tiles of the files it holds a step smaller or bigger: sm a 288px row with 6px between its tiles, base 320px with 8px (the default), or lg 384px with 12px, their icons, insets and words a step with them.
Border radius
borderRadius sets the corners of the drop area, and of the tiles of the files it holds, on the kit's one scale: none, xs 4px, sm 6px, base 8px (the default), lg 12px or xl 16px.
Media
media sets how a chosen file is drawn: "image", the default, as its photo, "icon" as its svg inline in the text colour, and "file" as a file icon over its name.
Max files
maxFiles is how many files the field takes, one by default, after which its drop area hides; here each holds one file, and the one that takes four still offers more.
Source
source="library" picks from the host's FilesPicker, a library of the files the app already holds, here a stand-in, beside "device", the default, which takes a file from the device.
Disabled
disabled dims the field, stops it taking or removing files and takes it out of the tab order, beside one as it is by default.
Invalid
error writes what is wrong under the dropzone and reaches its file input as aria-invalid, turning the drop area's border to the destructive colour, beside one without an error.
API Reference
Dropzone
DropzoneProps · components/Dropzone/Dropzone.types.tsDropzoneItem
DropzoneItemProps · also takes the props of <button>DropzoneItemLink
DropzoneItemLinkProps · also takes the props of <a>DropzoneFile
used by valueFilesPickerProps
used by pickerIt also takes the props of <div>.