You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[ESLint] Add a rule about wrapping EuiButtonIcon with EuiToolTip #9578
EuiButtonIcon requires an aria-label for accessibility and Kibana adoption is near-universal (98%). However, aria-label is only consumed by screen readers. Sighted users get no visible tooltip cue unless the button is explicitly wrapped with EuiToolTip.
As a workaround, 82 instances in Kibana (8%) set the HTML title attribute to surface a tooltip for sighted users. This is the wrong approach: browser-native tooltips are unstyled, have no delay control, no keyboard accessibility and are inconsistent with the EUI design system.
The correct pattern is to wrap EuiButtonIcon with EuiToolTip, using the button's label as the tooltip content:
@mattkime that's a good question! We're not wrapping the button internally because we want to keep it atomic and avoid interface bloat (extra tooltip props, conditional rendering) and avoid breaking the single-responsibility principle. Additionally, the aria-label isn't the same in all cases - most often it shouldn't be identical to the tooltip text - so coupling them (using whatever you pass as aria-label as the tooltip content) would lead to worse a11y. Finally, there are cases where we really don't want a visible tooltip at all. The idiomatic React approach here is composition. The tradeoff is ergonomics, but from EUI's perspective that's acceptable, which is also why we're handling the migration ourselves and added an ESLint rule to stand guard.
Activity
mattkime commentedon Jun 1, 2026
I'm curious - is there a reason why the tooltip hasn't been made internal to EuiButtonIcon?
weronikaolejniczak commentedon Jun 1, 2026
@mattkime that's a good question! We're not wrapping the button internally because we want to keep it atomic and avoid interface bloat (extra tooltip props, conditional rendering) and avoid breaking the single-responsibility principle. Additionally, the
aria-labelisn't the same in all cases - most often it shouldn't be identical to the tooltip text - so coupling them (using whatever you pass asaria-labelas the tooltip content) would lead to worse a11y. Finally, there are cases where we really don't want a visible tooltip at all. The idiomatic React approach here is composition. The tradeoff is ergonomics, but from EUI's perspective that's acceptable, which is also why we're handling the migration ourselves and added an ESLint rule to stand guard.