How to embed an icon in an option for a FluentSelect programmatically? #324
-
The examples for The FluentSelect at https://brave-cliff-0c0c93310.azurestaticapps.net/Select show that you can add an icon to an option declaratively: Programmatically we are stuck with using just Option. This has no way to embed an icon. How should this be done? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Beta Was this translation helpful? Give feedback.
Good question. I don't think there is a way to do this yet. Creating a list of
<FluentOption>
s is not the right way. The warnings you get then are to be expected.What I could do is add a new
Icon
property to theOption<>
class. The type of the property would be aTuple
with the neededicon parameters, i.e.:
At the place you are generating your
Option
collection you would then do something like this to add an option with an icon.: