ParticipantName
function ParticipantName(__namedParameters): Element;Defined in: packages/react/src/components/participant/ParticipantName.tsx:37
The ParticipantName component displays the name of the participant as a string within an HTML span element. If no participant name is undefined the participant identity string is displayed.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | ParticipantNameProps |
Returns
Element
Example
// Basic — display the current participant's name.
<ParticipantName name="Ava Chen" />
// Advanced — render a room roster from participant context.
function RoomRoster() {
const participants = useParticipants();
return (
<VoiceRoom agent={agent}>
<ParticipantLoop participants={participants}>
<ParticipantName />
</ParticipantLoop>
</VoiceRoom>
);
}