Valora
API Reference@valora-ai/reactindexFunctions

useParticipantTile

function useParticipantTile<T>(options): {
  elementProps: ParticipantTileElementProps<T>;
};

Defined in: packages/react/src/hooks/participant/useParticipantTile.ts:51

The useParticipantTile hook is used to implement the ParticipantTile and returns the props needed to render the tile.

Type Parameters

Type ParameterDefault type
TTrackSource

Parameters

ParameterType
optionsUseParticipantTileOptions

Returns

{
  elementProps: ParticipantTileElementProps<T>;
}

elementProps

elementProps: ParticipantTileElementProps<T>;

Example

// Basic — get element props for a participant tile.
const { elementProps } = useParticipantTile({ htmlProps: {} });

// Advanced — wire tile props and click handling to a track reference.
function CustomParticipantTile({ trackRef }: { trackRef: TrackReferenceOrPlaceholder }) {
  const { elementProps } = useParticipantTile({
    trackRef,
    htmlProps: { className: "participant-tile" },
    onParticipantClick: (event) => console.log(event),
  });

  return <div {...elementProps}><ParticipantTile trackRef={trackRef} /></div>;
}

On this page

Valora is local-first

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

Star on GitHub