Skip to main content

Upload

A click-or-drag dropzone that reads selected files into data URLs and renders a removable list, with image previews. Uncontrolled by default; pass value + onChange to control it.

import { Upload } from '@jbpark/ui-kit';

<Upload accept="image/*" maxCount={3} />;

Props

PropTypeDefault
multiplebooleantrue
acceptstring (input accept, e.g. 'image/*')'image/*'
maxCountnumber (max files; omit for unlimited)-
disabledboolean-
valueUploadFile[] (controlled)-
defaultValueUploadFile[][]
onChange(files: UploadFile[]) => void-
onReject(info: { file: File; reason: 'max-count' | 'read-error' }) => void-
classNames{ dropzone?: string; list?: string; item?: string }-
classNamestring-

UploadFile is { uid: string; name: string; url: string }, where url is a data URL. Files exceeding maxCount or that fail to read are surfaced through onReject rather than being added.