List participants
useParticipantIds returns an array of participant session IDs and updates as people join and leave. It is the starting point for any grid or list:
Filter and sort
Passfilter and sort to scope the list. String-based filters and sorts are computed directly from the internal store and are cheaper than a custom function evaluated at runtime:
'local', 'remote', 'screen', 'owner', and 'record'; built-in sorts are 'joined_at', 'session_id', 'user_id', and 'user_name'. For anything more specific, pass a function that receives the full participant object:
useParticipantIds also accepts event callbacks (onParticipantJoined, onParticipantLeft, onParticipantUpdated, onActiveSpeakerChange) if you need to react to a change rather than just render the current list.
Read a single property
useParticipantProperty reads one property (or a few) of a participant and re-renders only when that property changes. This is the workhorse hook for tiles:
'tracks.video.subscribed'), and you can request several at once by passing an array:
Use
useParticipantProperty instead of the deprecated useParticipant, which returns the whole participant object and re-renders on any change to it. useParticipant, useLocalParticipant, and useActiveParticipant were all deprecated in 0.17.0 for this reason.The local participant
You usually want the local participant’s session ID, not the whole object.useLocalSessionId gives you just that, and you compose it with the other hooks:
Who is speaking
useActiveSpeakerId returns the session ID of the current active speaker, or null when nobody has spoken. Pass ignoreLocal to exclude yourself, or a filter to limit which participants can become the active speaker:
Count participants
useParticipantCounts returns present and hidden counts. hidden counts participants with hasPresence: false, such as observers or bots:
Choosing the right hook
Next steps
Rendering media
Turn participant IDs into video and audio.
Active speaker and audio levels
Highlight whoever is talking.