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
Mantine
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/coreDropzone 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
Dra bilder hit eller klikk for å velge filer
Godtar kun bildefiler, maks 5MB per fil
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
Idle
Hover
Accept
Reject
Disabled
| State | Token | Notes |
|---|---|---|
| Idle | --mantine-color-default-border, --mantine-color-surface | Dashed border. |
| Hover | --mantine-color-surface-grey | Background only. |
| Accept | --mantine-color-primary, --mantine-color-surface-warm | A file that passes accept. Border and background change. |
| Reject | --mantine-color-error-border, --mantine-color-surface-warm | A file that fails accept or maxSize. Border and background change. |
| Disabled | --mantine-color-surface-grey, --mantine-color-disabled-color | Background 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.
| Property | Type | Allowed values | Default | Description |
|---|---|---|---|---|
radius | MantineRadius | number | — | md | Rounds 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.