Fluent UI Icon: Render an alternate icon in case the icon name provided is wrong #24335
-
Hello @fabricteam , I am trying to find out if there is any capability in Fluent UI Icon component to render an alternative icon or a default icon in case the icon name provided is not an existing icon? I am asking this because I am currently working on a feature where the icon name is being set by an API value and I want to set a default icon name in case the API returns icon names that don't exist. Thanks for all your help. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There is nothing built into the component to allow for an alternative icon to be used. You might consider wrapping the Icon in a component of your own that checks for the icon availability before rendering the Fluent UI icon. |
Beta Was this translation helpful? Give feedback.
There is nothing built into the component to allow for an alternative icon to be used. You might consider wrapping the Icon in a component of your own that checks for the icon availability before rendering the Fluent UI icon.