Is there a way to use a byte string as an icon/avatar for chips?

In the example given in the documentation, the avatar is set via LeadingIconCss:

<SfChip ID="chip-avatar" EnableDelete="true">
    <ChipItems>
        <ChipItem Text="Anne" LeadingIconCss="anne"></ChipItem>
        ...
    </ChipItems>
</SfChip>

<style> #chip-avatar .anne { background-image: url('./anne.png') }
</style>

This is impractical if there are lots of people that could be in the chipitems list, and the images must be in the wwwroot. 

Is there a way to dynamically assign an image to use as an avatar (e.g. from a byte string that has been loaded from a database) in a similar way that images can be displayed via byte strings? 

      string imagesrc = "data:image/png;base64," + base64String;
      <div class="image"> 
           <img src="@imagesrc" /> 
      </div> 

Thanks

Andrew



1 Reply

SS Sivakumar ShunmugaSundaram Syncfusion Team August 12, 2022 01:58 PM UTC

Hi Andrew,


From the explanation, we understand that you want to dynamically assign an image element to use as an avatar in the Blazor Chips component. But currently, we don’t have Template support to render any HTML elements within the Chips component. We have already considered this requirement as a feature from our end. Support for this feature will be included in any of our upcoming releases.


Usually, Syncfusion will plan and implement the features based on feature rank, customer requested count, and volume wish-list. We will let you know when this feature is planned for upcoming releases. The status of the implementation can be tracked through the below portal link.


Feedback: https://www.syncfusion.com/feedback/33728/provide-template-support-to-render-any-html-elements-within-blazor-chips-component


Please get back to us if you need any further assistance.


Regards,

Sivakumar S


Loader.
Up arrow icon