Skip to content

DropZone: Allow overriding children #14335

Closed

Description

@swissspidy

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.

Activity

  1. added
    [Type] Enhancement
    [Feature] Drag and Drop
    on Mar 8, 2019
  2. youknowriad commented on Apr 10, 2020

    @youknowriad
    Contributor

    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.

  3. added
    [Package] Components
    on Sep 12, 2022
  4. Mamaduka commented on May 8, 2025

    @Mamaduka
    Member

    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.

  5. self-assigned this
    on May 8, 2025
  6. added
    [Status] In Progress
    on May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Feature] Drag and Drop[Package] Components[Status] In Progress[Type] Enhancement

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions