Valora
API Reference@valora-ai/reactindexFunctions

useParticipants

function useParticipants(_options?): unknown[];

Defined in: packages/react/src/hooks/participant/useParticipants.ts:68

The useParticipants hook returns all participants (local and remote) of the current room.

Parameters

ParameterType
_options?UseParticipantsOptions

Returns

unknown[]

Example

// Basic — render every participant in the current room.
const participants = useParticipants();
<ParticipantLoop participants={participants}><ParticipantName /></ParticipantLoop>;

// Advanced — build a live roster inside the room context.
function Roster() {
  const participants = useParticipants();

  return <>
    <ParticipantLoop participants={participants}>
      <ParticipantName />
    </ParticipantLoop>
    <span>{participants.length} participants</span>
  </>;
}

function App() {
  return <VoiceRoom agent={agent}><Roster /></VoiceRoom>;
}

On this page

Valora is local-first

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

Star on GitHub