GitHub

Source

ParticipantLoop

The ParticipantLoop component loops over an array of participants to create a context for every participant. This component takes exactly one child component as a template. By providing your own template as a child you have full control over the look and feel of your participant representations.

Import

import { ParticipantLoop } from "@livekit/components-react";

Remarks

If you want to loop over individual tracks instead of participants, you can use the TrackLoop component.

Usage

const participants = useParticipants();
<ParticipantLoop participants={participants}>
<ParticipantName />
<ParticipantLoop />

Properties

childrenReact.ReactNode

The template component to be used in the loop.

participantsParticipant[]

The participants to loop over. Use useParticipants() hook to get participants.