diff --git a/packages/plugin-api/src/icons/types.ts b/packages/plugin-api/src/icons/types.ts index 156ab3e0b6..b0932bdb3a 100644 --- a/packages/plugin-api/src/icons/types.ts +++ b/packages/plugin-api/src/icons/types.ts @@ -15,6 +15,19 @@ */ import { ComponentType } from 'react'; -// import { SvgIconProps } from '@material-ui/core'; -export type IconComponent = ComponentType; +/** + * IconComponent is the common icon type used throughout Backstage when + * working with and rendering generic icons, including the app system icons. + * + * The type is based on SvgIcon from MUI, but both do not what the plugin-api + * package to have a dependency on MUI, nor do we want the props to be as broad + * as the SvgIconProps interface. + * + * If you have the need to forward additional props from SvgIconProps, you can + * open an issue or submit a PR to the main Backstage repo. When doing so please + * also describe your use-case and reasoning of the addition. + */ +export type IconComponent = ComponentType<{ + fontSize?: 'default' | 'small' | 'large'; +}>; diff --git a/packages/plugin-api/src/index.ts b/packages/plugin-api/src/index.ts index 144e125204..f91d97c31d 100644 --- a/packages/plugin-api/src/index.ts +++ b/packages/plugin-api/src/index.ts @@ -17,6 +17,7 @@ export * from './apis'; export * from './app'; export * from './extensions'; +export * from './icons'; export * from './plugin'; export * from './routing'; export * from './types';