Provide support for LivePersonaCard in 3rd-party solutions
The LivePersonaCard control, which renders a user's full profile card, can be loaded in a SPFx solution with LoadByComponentId. However, it is unclear whether this will be supported in the future.
The PnP reusable controls has a Pull Request to provide developers with a LivePersonaCard control, but it is currently in holding pattern until it can be confirmed that LivePersonaCard (and LoadByComponentId) will be supported.
Please empower 3rd party developers to build rich user-aware SharePoint solutions by providing solution for the live persona card.
After reviewing all the related threads in GitHub, I believe MS's current recommendation is to use the Person-Card component in the Graph Tool Kit. However, that does not provide the feature-rich capabilities like Org Chart, Files, etc. contained in the OOB SharePoint profile card. So the only option at this time is the 'hacky' version (to quote Mikael), in order to get full feature capabilities, which is not ideal.
A small update. There are technical challenges to overcome before the LPC can be exposed as a 3rd party developer component in a supported way for SharePoint scenarios, and it will not happen for at least 6 months due to other priorities. This is not saying it won't happen as the teams involved do understand the use case. But to get there requires refactoring of how the component works today.
Max Goss commented
I would agree with the comments below here. If a company is building a new contact directory for staff / students what is the recommended approach? Ideally we would be able to extend the first party people component and augment with our own data. It doesn't seem like Graph toolkit offers this. What we really need is a way to extend the first party component possibly as a React / PNP control? What does the roadmap look like for this?
Adrian Johnson commented
Currently building a contact directory for a customer, the behaviour / look of the out of box card is great however we're dealing with custom fields in User Profile Service / Graph and so whether or not using it in our solution is a 'hack' or won't be supported in the future, it won't fit the bill anyway.
What is the current sanctioned approach for this? We've looked at the Graph toolkit but frankly, if we're aiming for similar levels of functionality to the SP card, it seems it would be easier to start it from scratch with what's available across PnP / SPFx / Fabric UI.
Is a fully bespoke solution the only real option for the time being, is there something coming up in the future that will offer a different approach?
While I appreciate the effort with the Graph Toolkit, it is absolutely going in the wrong direction. We want to use a COMMON control to make all our solutions look and behave consistently, not introduce a new control that works differently.
This is especially going to become a relevant conversation with the eventual release of Project Cortex.
Steve B. commented
I don't get why it's so hard for microsoft to admit allowing using LivePersonaComponent or any supported wrapper around it, is a good idea.
Everyone here is telling "Hey! All my people fields should behave similarely!".
But the only answer is "No it's not possible". Workaround are not satisfying (not complete card, incompatible with IE, ...).
I can hear the technical answer "LoadComponentbyId isn't supported". But It's harded to hear "We won't allow you to create homogeneous UI".
So please, MS, create an officially supported way to reuse standard live persona card. No erzatz.
Heinrich Ulbricht commented
I'm again in a project where we have the requirement to add the same persona card as the users see in SharePoint.
Users are familiar with the SharePoint persona card and understandably expect the same functionality in our custom-built SPFx solutions. The cost of development should be reasonable as well.
We need the solution proposed by Hugo (see his pull request link) and might go for it this time.
Since this proposal gathered a reasonable amount of votes it would be nice to get an update on if it is still being considered to make the out-of-the-box component accessible for us.
There is now access to the LPC via the Graph Toolkit at https://docs.microsoft.com/en-us/graph/toolkit/components/person-card - but aware that it's not the complete card.
Appreciate the comments (and knew of scenario's), and having them written here will help drive this forward. I will report back when I have more information.
João Mendes commented
React- Diretory Web Part available on https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-directory
use LPC, to quick access user information on search company directory.
Some real world scenarions:
- Custom predictive search that displays user cards as we type.
- Custom Activity Stream webpart that shows item authors.
Hovering over the user cards and seening this amazing Persona card provides a great user experience.
Hugo Bernier commented
Throughout SharePoint, the user experience is consistent: when you see a person's name, you can mouse over their name to get more information and/or connect with them.
The goal is to allow developers to build SPFx web parts which handle displaying a user profile in a manner that is consistent with the out-of-the-box web parts.
For example, if I wanted to build an employee directory web part, a org chart web part, or an office map web part.
A real life scenario: we recently had to build a web part for a student portal for a large college which shows a student's advisor. We used the Fabric UI Persona Card, but we wanted to make it easier for students to get in touch with their advisors, book an appointment, etc. We had to write everything with custom code, but it would have been a lot easier with the LPC.
I hope this answers your question?
It would be helpful to get some concrete scenarios for exposing the LPC (Live Persona Card) to third parties. What scenarios will it enable or help which is not solved today by the existing web parts?