LevelChatDocs
Docs
ParticipantGrid

Components

ParticipantGrid

Speaker-biased, paginated grid of VideoTiles.

ParticipantGrid is the canonical meeting layout — every participant in a responsive grid that auto-scales from 1×1 up to 4×4, with the rest paginated. Local participant always slot 0, active speakers float upward.

Install

pnpm add @levelchat/react-components @levelchat/web

Basic usage

import { ParticipantGrid } from '@levelchat/react-components';

export function MeetingStage() {
  return <ParticipantGrid maxVisible={16} />;
}

Headless hook

Use useParticipants when you want a custom layout. It returns a stable, sorted array (local first, then speaking-time descending, then join time):

import { useParticipants, VideoTile } from '@levelchat/react-components';

function MyGrid() {
  const participants = useParticipants();
  return (
    <div className="grid grid-cols-4 gap-2">
      {participants.map((p) => (
        <VideoTile key={p.id} participantId={p.id} name={p.displayName ?? undefined} />
      ))}
    </div>
  );
}

Sorting + pagination

  • Stable sort: localspeakingjoined-at ascending.
  • Batch SDK deltas via useSyncExternalStore — no flicker when two participants join in the same WebSocket frame.
  • Overflow beyond maxVisible renders a "+N more" tile that opens a pagination drawer (or is dropped entirely when overflow="hide").

Props

PropTypeDefaultNotes
maxVisiblenumber16Max tiles rendered before overflow kicks in.
overflow'paginate' | 'hide'paginateWhat to do when participant count exceeds maxVisible.
cornerRadiusnumberPer-tile corner radius override.
classNamestringOverride the grid container styling.
ParticipantGrid — LevelChat Docs