Valora
API Reference@valora-ai/reactindexFunctions

ParticipantLoop

function ParticipantLoop(__namedParameters): Element;

Defined in: packages/react/src/components/participant/ParticipantLoop.tsx:48

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

Parameters

ParameterType
__namedParametersParticipantLoopProps

Returns

Element

Example

// Basic — render a name for every participant.
const participants = useParticipants();
<ParticipantLoop participants={participants}>
  <ParticipantName />
</ParticipantLoop>;

// Advanced — build a roster with participant context per row.
function Roster() {
  const participants = useParticipants();

  return (
    <VoiceRoom agent={agent}>
      <ParticipantLoop participants={participants}>
        <ParticipantContextIfNeeded><ParticipantName /></ParticipantContextIfNeeded>
      </ParticipantLoop>
    </VoiceRoom>
  );
}

On this page

Valora is local-first

No API key, no server — everything in this doc runs on-device.

Star on GitHub