diff --git a/src/platformIcon.tsx b/src/platformIcon.tsx index ce85c8a..bf690f0 100644 --- a/src/platformIcon.tsx +++ b/src/platformIcon.tsx @@ -301,6 +301,8 @@ type Props = React.HTMLAttributes & { radius?: number | null; withLanguageIcon?: boolean; languageIconStyles?: React.CSSProperties; + /** Accessible label for the icon. Defaults to the platform name. Pass an empty string to mark the icon as decorative. */ + alt?: string; }; const PlatformIcon = ({ @@ -311,6 +313,7 @@ const PlatformIcon = ({ withLanguageIcon, languageIconStyles = {}, style = {}, + alt = platform, ...otherProps }: Props) => { const icon = getIcon(platform); @@ -322,15 +325,22 @@ const PlatformIcon = ({ if (withLanguageIcon && languageIcon !== icon && languageIcon !== "default") { return ( -
+