Skip to content

Dropzone

Open .md
Live preview

Loading example…

Dropzone is part of the Forms set, imported from @jcsoftdev/ui/forms.

import { Dropzone } from "@jcsoftdev/ui/forms";

Single-component entry points tree-shake to just this component: @jcsoftdev/ui/forms/dropzone.

<Dropzone
title="Arrastra la foto del corte"
hint="PNG o JPG, máximo 2 MB"
browseLabel="Elegir archivo"
acceptedTypes={["image/*"]}
maxSizeBytes={2 * 1024 * 1024}
multiple
/>
Prop Type Default Description
onFiles * (files: File[]) => void
onReject ((rejections: DropzoneRejection[]) => void) Called with the rejected files; the caller composes the user-facing message.
acceptedTypes string[] Accepted MIME types; supports wildcards such as image/*.
maxSizeBytes number
multiple boolean true
title * string
hint string
browseLabel * string
className string

* marks a required prop.

packages/ui/src/forms/dropzone/dropzone.tsx