Search code examples
typescriptbotframeworkmicrosoft-teamsadaptive-cards

How to render person card similar to MS Teams WhoBot?


How to render a person card with status and icons similar to a fluent UI react persona component in MS adaptive cards for a bot framework implementation? Something similar to the whobot person card as given below with the all the attributes, online status and icons? Can someone please guide me on how to achieve this for a bot framework implementation?

enter image description here


Solution

  • The card itself is quite simple and can be easily created from samples so i won't go into this detail here but this might be a good start for you -> https://www.madewithcards.io/cards/who-sample-card

    Note: You can't create the same appearance for the status icon, you need to have a label giving you the status at this state. An overlay over an image is not possible atm. You could create a specific endpoint that renders the avatar together with the status as one image and return it from your bot that might be complete overkill, just use a label to begin with.

    To get the data you'd need you need to use the Graph Api in your Bot before rendering the card.

    If you have the data you only need to fill your card and can send it to teams. You won't have the popups when hovering over the icons tho this is not possible with Adaptive Cards today.

    Hope that helps a bit :)