WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.49k stars 4.18k forks source link

Allow define RadioControl label with ReactNode component #66615

Open retrofox opened 2 days ago

retrofox commented 2 days ago

What?

This PR allows using a ReactNode element for label in the RadioControl component

Why?

Because sometimes it's desired to render not only text for the radio control label

How?

Testing Instructions

  1. Run storybook
npm run storybook:dev
  1. Go to the new With Component Labels story
  2. Confirm the story works as expected
image

Testing Instructions for Keyboard

Screenshots or screencast

github-actions[bot] commented 2 days ago

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: retrofox <retrofox@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.