diff --git a/docs/sources/developers/plugins/migration-guide/v10.0.x-v10.1.x/_index.md b/docs/sources/developers/plugins/migration-guide/v10.0.x-v10.1.x/_index.md
new file mode 100644
index 00000000000..01818e3e5f2
--- /dev/null
+++ b/docs/sources/developers/plugins/migration-guide/v10.0.x-v10.1.x/_index.md
@@ -0,0 +1,29 @@
+---
+description: Guide for migrating plugins from Grafana v10.0.x to v10.1.x
+keywords:
+ - grafana
+ - plugins
+ - migration
+ - plugin
+ - documentation
+title: Migrate plugins from Grafana 10.0.x to 10.1.x
+menutitle: v10.0.x to v10.1.x
+weight: 1900
+---
+
+# Migrate plugins from Grafana version 10.0.x to 10.1.x
+
+## Accessibility update for IconButton component in grafana-ui
+
+We updated the component's TypeScript interface due to an accessibility issue. This change was delivered to the core `grafana` repo with [PR 69699](https://github.com/grafana/grafana/pull/69699).
+
+In case you are using the IconButton component in your plugin you will get TypeScript errors related to the change.
+
+**Recommended actions:**
+
+- Review use cases of IconButton in your plugin.
+- Add a meaningful tooltip which the component will also use as an aria-label.
+- Another option is to set an aria-label. In this case a tooltip will not be shown.
+
+**Please note:**
+The IconButton used to have a property called `ariaLabel` which got deprecated with this change. You can now use the regular property `aria-label` instead.
diff --git a/packages/grafana-ui/src/components/IconButton/IconButton.mdx b/packages/grafana-ui/src/components/IconButton/IconButton.mdx
index c8190bca17c..8d64adf442b 100644
--- a/packages/grafana-ui/src/components/IconButton/IconButton.mdx
+++ b/packages/grafana-ui/src/components/IconButton/IconButton.mdx
@@ -1,17 +1,23 @@
import { Meta, ArgTypes } from '@storybook/blocks';
import { IconButton } from './IconButton';
+import { Icon } from '../Icon/Icon';
import { Alert } from '../Alert/Alert';
# IconButton
-This component looks just like an icon but behaves like a button. It fulfils an action when you click it and has hover and focus states. You can choose which icon size you would like to use.
+This component looks just like an icon but behaves like a button. It fulfils an action when you click it and has a hover as well a focus states. You can choose which icon size you would like to use.
`IconButton` is best used when you only want an icon instead of a button with text, for example when you want to place a solitary clickable icon next to text. An example where an `IconButton` is used in Grafana is the hamburger icon at the top left which opens the new navigation.
When using `IconButton` right next to a text element consider wrapping both in a flex container and use `align-items: center;` to make them align properly.
-Always keep in mind to add text for a tooltip and an aria label.
+There are two options to use the IconButton:
+
+- with `Tooltip`: This is the preferred option since we don't want to rely on assumptions when it comes to the meaning an `Icon` has. Add a text for the `Tooltip`. It will be used for the `aria-label` as well.
+- without `Tooltip`: This is an option for use cases where the `Icon` is unambiguous e.g for expanding a folder. Add a text for the `aria-label` and there will **not** be a `Tooltip`.
+
+The IconButton used to have a property called `ariaLabel` which got deprecated. You can now use the regular property `aria-label` instead.
After reviewing this component we would like you to know that there are only 5 sizes available (sizes xs to xl). Sizes
diff --git a/packages/grafana-ui/src/components/IconButton/IconButton.story.tsx b/packages/grafana-ui/src/components/IconButton/IconButton.story.tsx
index 011f3bdafc7..304e7ae9656 100644
--- a/packages/grafana-ui/src/components/IconButton/IconButton.story.tsx
+++ b/packages/grafana-ui/src/components/IconButton/IconButton.story.tsx
@@ -7,13 +7,16 @@ import { IconSize, IconName } from '../../types';
import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
import { HorizontalGroup, VerticalGroup } from '../Layout/Layout';
-import { IconButton, IconButtonVariant, Props as IconButtonProps } from './IconButton';
+import { BasePropsWithTooltip, IconButton, IconButtonVariant, Props as IconButtonProps } from './IconButton';
import mdx from './IconButton.mdx';
interface ScenarioProps {
background: 'canvas' | 'primary' | 'secondary';
}
+const defaultExcludes = ['ariaLabel', 'aria-label'];
+const additionalExcludes = ['size', 'name', 'variant', 'iconType'];
+
const meta: Meta = {
title: 'Buttons/IconButton',
component: IconButton,
@@ -22,6 +25,7 @@ const meta: Meta = {
docs: {
page: mdx,
},
+ controls: { exclude: defaultExcludes },
},
args: {
name: 'apps',
@@ -30,7 +34,8 @@ const meta: Meta = {
tooltip: 'sample tooltip message',
tooltipPlacement: 'top',
variant: 'secondary',
- ariaLabel: 'sample aria-label content',
+ ariaLabel: 'this property is deprecated',
+ ['aria-label']: 'sample aria-label content',
},
argTypes: {
tooltip: {
@@ -43,7 +48,7 @@ export const Basic: StoryFn = (args: IconButtonProps) => {
return ;
};
-export const ExamplesSizes = () => {
+export const ExamplesSizes = (args: BasePropsWithTooltip) => {
const theme = useTheme2();
const sizes: IconSize[] = ['xs', 'sm', 'md', 'lg', 'xl'];
const icons: IconName[] = ['search', 'trash-alt', 'arrow-left', 'times'];
@@ -56,17 +61,22 @@ export const ExamplesSizes = () => {
`;
return (
-
+
{variants.map((variant) => {
return (
-