-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Open
Labels
[Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).Changes that impact accessibility and need corresponding review (e.g. markup changes).[Package] Components/packages/components/packages/components
Description
In some cases, we'd like to pass not only a string to the label property of the options item.
Consider the following one:
<RadioControl
options={[
{
label: <Rating value={ 4 } />
value: '4'
},
//...
]}
// ...
/>...to render something like...
Questions:
- Should the
labelaccept a React Component Instead of a String?
Allowing label to accept a React component could enable richer, more flexible user interfaces. This would be particularly useful for custom icons, rating displays, or other visual indicators.
- Accessibility Concerns
Labels in RadioControl are simple strings, which are generally straightforward to manage for screen readers. Allowing components might introduce accessibility issues. How can we deal with the a11y?
So, I'd like your opinion on addressing this issue before I start digging into a tentative implementation.
cc @WordPress/gutenberg-components
Metadata
Metadata
Assignees
Labels
[Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).Changes that impact accessibility and need corresponding review (e.g. markup changes).[Package] Components/packages/components/packages/components
