ParticipantsPanel is the right-rail roster: search field at the top, scrollable list of participants with their mic/cam/role indicators, host-only mute / promote / remove actions on hover. Composes useParticipants.
Install
pnpm add @levelchat/react-components @levelchat/webRequirements
- React —
reactandreact-dom^18 || ^19(peer dependency). - LevelChat Web SDK —
@levelchat/web^0.2.4(peer dependency, wires hook-driven mode to the live Room). - Provider — wrap the tree in
<LevelChatProvider>from@levelchat/web-reactso hook-driven mode can subscribe to room events. Prop-driven demos work without it. - Styles — import the brand tokens + kit stylesheet exactly once at the app entry, before any kit component renders.
In Next.js (App Router), import the stylesheets at the top of your root layout:
TypeScript (TSX)
// app/layout.tsx
import '@levelchat/brand/tokens.css';
import '@levelchat/react-components/styles.css';In Vite (or any plain React app), import them at the top of your entry module:
TypeScript (TSX)
// src/main.tsx
import '@levelchat/brand/tokens.css';
import '@levelchat/react-components/styles.css';Basic usage
TypeScript (TSX)
import { ParticipantsPanel } from '@levelchat/react-components';
<ParticipantsPanel className="h-full w-72" />Host controls
Host actions (mute someone, promote to co-host, remove) only render when the local participant's role is host or co-host. The SDK enforces this server-side too — passing isHost manually is a UI hint, not a privilege grant.
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
isHost | boolean | auto from SDK | Override host detection (e.g. for previews). |
showSearch | boolean | true | Render the search field at the top of the roster. Pass false to hide it for small rosters. |
onMute / onRemove / onPromote | (p: ParticipantSummary) => void | — | Host-action callbacks — wire these to your moderation RPCs. |
hideLocal | boolean | false | Omit the local participant from the roster list. |
className | string | — | Container override. |