Skip to content

[EuiColorPicker][A11y] Add accessible color swatch labels #8429

Description

@JasonStoltz

Is your feature request related to a problem? Please describe.
Per bug elastic/kibana#210611 in Kibana:

Colors in squares doesn't have labels for them.

(because otherwise the person who doesn't distinguish between colors won't know what color he/she is selecting until pressing Enter on it and when in the Color field he/she will see the color code). Or color code in Color field is changing when user is navigating through colors which are in squares by pressing Tab key.

Users use the EuiColorPicker to select colors. The options available in the EuiColorPicker are presented as color swatches, with no other labels or contexts. Since people might see color differently or not at all, it makes it hard for users to reliably select colors correctly when choosing between color swatches.

While it is hard for users to select a color, it is not impossible. If users navigate through the color swatch options via keyboard, or select color swatch options, they will see the corresponding hex value below.

Image

Describe the solution you'd like
@mgadewoll Proposed a solution here.

The solution here would be to add a tooltip to provide a visible label.

with human readable color name with custom hex code
Image Image

The proposal mentions potential paths for showing labels:

  • Raw hex values - I believe showing raw hex values in a label is the minimum that we would need to do here.
  • Human readable color name - This will not always be possible, but if and when it is possible, it may be ideal. Though I think we'd need to validate that this is ideal or not.

Describe alternatives you've considered
N/A

Desired timeline
TBD

Additional context

Activity

  1. mgadewoll commented on Mar 17, 2025

    @mgadewoll
    Contributor

    As mentioned in this issue: We should also look into potentially adding labels for the EuiHue and EuiSaturation thumbs as they select the color as well but don't visually indicate what the color is (besides filling the input)

    I'd suggest checking the behavior here first and seeing if it's necessary.

  2. changed the title [-]Add accessible color swatch labels to EuiColorPicker[/-] [+][EuiColorPicker ] Add accessible color swatch labels[/+] on Mar 17, 2025
  3. self-assigned this
    on Mar 18, 2025
  4. changed the title [-][EuiColorPicker ] Add accessible color swatch labels[/-] [+][EuiColorPicker][A11y] Add accessible color swatch labels[/+] on Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions