Skip to content

Consolidate the Button component implementations for use in blocks #14935

@pablinos

Description

@pablinos

The problem

We currently have three implementations of a button component that are used to add buttons to some of the blocks. A common pattern is to have a button block style as well as an inline style for embed blocks like Eventbrite and Calendly. A button is also used as an InnerBlock of the contact form and similarly with the Revue block. It's also used with the MailChimp and Recurring Payments blocks.

The main SubmitButton implementation has got out of sync with the core button block component and doesn't have the same features. The other two implementations were an attempt to remedy this, with the version used in the Revue block being closest to the current core version.

Proposed solution

We have been discussing the best approach to reusing the core button components. The current favoured solution is to adapt the button block so that the link settings UI can be turned off and then the button block can be used within block variations. This could work in some situations and needs to be explored further, but in the meantime, it seems appropriate to consolidate the implementations we currently have and get all the blocks using a button component that's as similar as possible to the core Gutenberg version.

To this end, @Copons has been exploring this with a PR to make the button used in the Revue block shared, and another PR that uses this shared component in the other blocks.

This issue is to track progress on those PRs as well as other possible solutions within Gutenberg.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions