NetworkIndicator renders a participant's connection quality bucket — one of good, fair, or poor — as either a small set of signal bars or as the 8-px status dot embedded in every VideoTile.
Install
pnpm add @levelchat/react-componentsBasic usage
Hook-driven (subscribes to the live quality score for that participant):
import { NetworkIndicator } from '@levelchat/react-components';
<NetworkIndicator participantId="user_42" />Or prop-driven for previews:
TypeScript (TSX)
<NetworkIndicator quality="fair" />As 8-px dot
Inside VideoTile we render the status as a small dot in the corner instead of the full bars; pass asDot:
<NetworkIndicator participantId="user_42" asDot />Headless hook
The styled component delegates to useConnectionQuality. Reach for the hook directly if you want to render a custom indicator:
import { useConnectionQuality } from '@levelchat/react-components';
function MyBars({ participantId }) {
const { quality } = useConnectionQuality({ participantId });
// quality: 'good' | 'fair' | 'poor' | undefined (unknown)
return <span>{quality ?? 'unknown'}</span>;
}Theming
The indicator colours come from three CSS tokens:
--lc-brand-primary—goodbucket.--lc-warning-solid—fairbucket.--lc-danger-solid—poorbucket.
The 8-px dot variant also paints a 2-px white halo so it stays readable when overlaid on a video tile.
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
participantId | string | — | Hook-driven mode. Mutually exclusive with quality. |
quality | 'good' | 'fair' | 'poor' | hook | Force the bucket. Wins over the hook. |
size | number | 16 | Pixel size of the bars (ignored when asDot). |
asDot | boolean | false | Render the 8-px corner dot variant instead of the bars. |
className | string | — | Pass-through class for extra layout/positioning. |