Custom icon in InfoLabel #29790
-
LibraryReact Components / v9 (@fluentui/react-components) Describe the feature that you would like addedI'd like to add a custom icon instead of the Have you discussed this feature with our teamNot yet Additional contextHere's what my own implementation looks like today: Validations
PriorityNormal |
Beta Was this translation helpful? Give feedback.
Answered by
miroslavstastny
Nov 7, 2023
Replies: 1 comment
-
You can override the default icon by passing it as a import {
Sparkle16Regular,
Sparkle16Filled,
bundleIcon
} from "@fluentui/react-icons";
//...
const Sparkle16 = bundleIcon(Sparkle16Filled, Sparkle16Regular);
//...
return (
<InfoLabel
info="This is example information for an InfoLabel."
infoButton={{ children: <Sparkle16 /> }}
>
Example label
</InfoLabel>
); Keep in mind that if you override the icon, it will be your responsibility to use the correct size of the icon. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
15MariamS
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can override the default icon by passing it as a
children
toinfoButton
slot:Keep in mind that if you override the icon, it will be your responsibility to use the correct size of the icon.
InfoLabel
will NOT scale the icon based on thesize
prop.