Valora
API Reference@valora-ai/reactindexFunctions

usePinnedTracks

function usePinnedTracks(layoutContext?): unknown[];

Defined in: packages/react/src/hooks/layout/usePinnedTracks.ts:30

The usePinnedTracks hook returns a array of the pinned tracks of the current room.

Parameters

ParameterType
layoutContext?LayoutContextType

Returns

unknown[]

Example

// Basic — read the currently pinned tracks.
const pinnedTracks = usePinnedTracks();

// Advanced — render pinned tracks before the main room grid.
function FocusedPins() {
  return (
    <VoiceRoom agent={agent}>
      <LayoutContext><PinnedTrackStage /></LayoutContext>
    </VoiceRoom>
  );
}
function PinnedTrackStage() {
  const pinnedTracks = usePinnedTracks();
  return <TrackLoop tracks={pinnedTracks}><ParticipantTile /></TrackLoop>;
}

On this page

Valora is local-first

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

Star on GitHub