You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I am trying to use the DropZone component together with Draggable to implement a simple sorting mechanism.
While doing so, I realized I can change the default "Drop files to upload" label, but not the upload icon.
In the 'BlockDropZone' component, this is "solved" by just hiding the content using CSS, which isn't really nice, but currently the only way to achieve this.
Describe the solution you'd like
It would be way easier if we could pass custom content as children or have some other way to remove the default content in DropZone.
Just nothing that there's a __unstableUseDropZone react hook allowing alternative UIs for drop zones. We should probably consider making this API stable instead of adding children support to DropZone.
Ideally, we'd also avoid the need for a DropzoneProvider at some point.
I think it makes sense, considering that __unstableUseDropZone still requires somewhat complex configuration, even in core, we use DropZone in a few places.
We can either allow overriding contents via children or support icon prop and only override the icon alongside the label.
P.S. The DropzoneProvider has been deprecated since WP 5.8.
Activity
Hide “Drop files to upload” text when dragging elements
youknowriad commentedon Apr 10, 2020
Just nothing that there's a
__unstableUseDropZonereact hook allowing alternative UIs for drop zones. We should probably consider making this API stable instead of adding children support to DropZone.Ideally, we'd also avoid the need for a DropzoneProvider at some point.
Mamaduka commentedon May 8, 2025
I think it makes sense, considering that
__unstableUseDropZonestill requires somewhat complex configuration, even in core, we useDropZonein a few places.We can either allow overriding contents via
childrenor supporticonprop and only override the icon alongside the label.P.S. The
DropzoneProviderhas been deprecated since WP 5.8.