Skip to main content

prefer-icon-button-tooltip

effort: 2m
has IDE fix
pro+

Warns when IconButton does not pass the tooltip argument.

Without a tooltip, screen readers like VoiceOver or TalkBack announce only "Button" or read out an unhelpful internal icon glyph code (e.g. "e14c, button").

This violates WCAG SC 4.1.2 because the control lacks an accessible name, rendering the button unusable for blind or low-vision users.

Example

❌ Bad:

// LINT: Tooltip is not specified.
// Try adding it or wrapping this widget into 'ExcludeSemantics'.
IconButton();
// LINT: Tooltip is not specified.
// Try adding it or wrapping this widget into 'ExcludeSemantics'.
IconButton(tooltip: '');

✅ Good:

IconButton(tooltip: 'some tooltip');
ExcludeSemantics(child: IconButton());

Additional Resources