Skip to content

Menu: Add "destructive" state #61079

@t-hamano

Description

@t-hamano

What problem does this address?

In WordPress core and Gutenberg, a button typically appears red if its action is destructive.

Delete Template:
image

Move Post to Trash:
image

Move Post to Trash (Classic Editor):
image

On the other hand, in the UI already implemented with DropdownMenuItemV2 components, these action buttons are not red.

Delete template:
image

Move Post to Trash:

image

What is your proposed solution?

As far as I know, no option exists to make the DropdownMenuItemV2 color red. I imagine that something like the isDestructive prop of the button component could be used for these use cases.

Below is a list of the states I would expect.

Default:

image

Hovered:

image

Focused:

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions