components / dropzone

dropzone.

standalone drag-and-drop upload zone — validates a drop against accept/maxSize/maxFiles and hands you File[], with optional rows showing size, upload progress and errors. stateless by design: upload transport is yours. drag depth is counted rather than flagged, so the highlight doesn't strobe when the pointer crosses a child, and the zone is a real button so click, enter and space all open the picker.

  • brief-v2.pdf277 kb
installation
bunx @justin06lee/chrome@latest add dropzone
props
nametypedefaultdescription
onFiles *(files: File[]) => void-receives everything that passed validation.
onReject(rejections: DropzoneRejection[]) => void-{ file, reason: 'type' | 'size' | 'count' }[].
acceptstring-native input syntax: '.pdf,.md,image/*'. also enforced on drop.
maxSizenumber-per-file limit in bytes.
maxFilesnumber-cap on files accepted per drop.
multiplebooleantrue
disabledbooleanfalse
labelReactNode'drop files here'
hintReactNode-second line — formats and limits.
filesDropzoneFile[]-{ id, name, size?, progress?, error? }[] rendered as rows under the zone.
onRemove(id: string) => void-adds a remove button to each row.
accentstring'#ffffff'active border and progress-bar colour.
classNamestring-