FocusToggle
function FocusToggle(__namedParameters): Element;Defined in: packages/react/src/components/layout/FocusToggle.tsx:42
The FocusToggle puts the ParticipantTile in focus or removes it from focus.
Parameters
| Parameter | Type |
|---|---|
__namedParameters | FocusToggleProps |
Returns
Element
Example
// Basic — add a focus control inside a participant tile.
<ParticipantTile>
<FocusToggle onChange={(pinned) => console.log({ pinned })} />
</ParticipantTile>
// Advanced — toggle focus for every camera tile in a room.
function FocusableGrid() {
const tracks = useTracks([{ source: Track.Source.Camera, withPlaceholder: true }]);
return (
<VoiceRoom agent={agent}>
<GridLayout tracks={tracks}>
<ParticipantTile><FocusToggle /></ParticipantTile>
</GridLayout>
</VoiceRoom>
);
}