frontend-plugin-api: IconElement

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2026-02-11 12:51:53 +01:00
parent 0ce750513d
commit c47f8402b9
2 changed files with 10 additions and 2 deletions
@@ -14,4 +14,4 @@
* limitations under the License.
*/
export type { IconComponent } from './types';
export type { IconComponent, IconElement } from './types';
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { ComponentType } from 'react';
import { ComponentType, JSX } from 'react';
/**
* IconComponent is the common icon type used throughout Backstage when
@@ -31,7 +31,15 @@ import { ComponentType } from 'react';
* also describe your use-case and reasoning of the addition.
*
* @public
* @deprecated Use {@link IconElement} instead, passing `<MyIcon />` rather than `MyIcon`.
*/
export type IconComponent = ComponentType<{
fontSize?: 'medium' | 'large' | 'small' | 'inherit';
}>;
/**
* The type used for icon elements throughout Backstage.
*
* @public
*/
export type IconElement = JSX.Element | null;