Skip to main content

Dropzone

An area where the user drops one or more files, or clicks to open the file picker. Use it for uploads where dragging is the expected way in.

Base
Mantine + override
Import
{ Dropzone } from '@mantine/dropzone'
Source
src/themes/component-overrides/inputs.ts
src/themes/style-overrides/dropzone.module.css
Imported from @mantine/dropzone, not @mantine/core

Dropzone is a separate package and is not re-exported by @multiconsult-group-products/design-system. Import it from @mantine/dropzone and it is styled by the theme.

Usage​

multiple
loading
disabled
React
<Dropzone
onDrop={(files) => handleFiles(files)}
accept={IMAGE_MIME_TYPE}
maxSize={5 * 1024 ** 2}
>
<Dropzone.Accept>{/* accepted icon */}</Dropzone.Accept>
<Dropzone.Reject>{/* rejected icon */}</Dropzone.Reject>
<Dropzone.Idle>{/* idle icon */}</Dropzone.Idle>
<div>{/* prompt text */}</div>
</Dropzone>

States​

StateTokenNotes
Idle--mantine-color-default-border, --mantine-color-surfaceDashed border.
Hover--mantine-color-surface-greyBackground only.
Accept--mantine-color-primary, --mantine-color-surface-warmA file that passes accept. Border and background change.
Reject--mantine-color-error-border, --mantine-color-surface-warmA file that fails accept or maxSize. Border and background change.
Disabled--mantine-color-surface-grey, --mantine-color-disabled-colorBackground and text or icon colour.

The drop area has a fixed minimum height of 192px.

Props​

Only what this design system changes. Everything else is Mantine's — read the full props table there.

PropertyTypeAllowed valuesDefaultDescription
radiusMantineRadius | number—mdRounds the drop area's corners to 8px. The theme default is sm.

Accessibility​

Text children name the dropzone. An icon-only dropzone needs an aria-label that says what it accepts. See Accessibility for what applies to every component.