diff --git a/packages/grafana-ui/src/components/IconButton/IconButton.tsx b/packages/grafana-ui/src/components/IconButton/IconButton.tsx index 6b745461282..43c000d9d94 100644 --- a/packages/grafana-ui/src/components/IconButton/IconButton.tsx +++ b/packages/grafana-ui/src/components/IconButton/IconButton.tsx @@ -26,17 +26,32 @@ export interface Props extends React.ButtonHTMLAttributes { tooltipPlacement?: TooltipPlacement; /** Variant to change the color of the Icon */ variant?: IconButtonVariant; + /** Text avilable ony for screenscreen readers. Will use tooltip text as fallback. */ + ariaLabel?: string; } type SurfaceType = 'dashboard' | 'panel' | 'header'; export const IconButton = React.forwardRef( - ({ name, size = 'md', iconType, tooltip, tooltipPlacement, className, variant = 'secondary', ...restProps }, ref) => { + ( + { + name, + size = 'md', + iconType, + tooltip, + tooltipPlacement, + ariaLabel, + className, + variant = 'secondary', + ...restProps + }, + ref + ) => { const theme = useTheme2(); const styles = getStyles(theme, size, variant); const button = ( - );