MicIndicator is the small mic chip that lives on every participant tile and in the control bar. It exposes both a hook-driven mode (subscribes to a participant's live audio state) and a prop-driven mode (forces a state for demos or static surfaces).
Install
pnpm add @levelchat/react-componentsBasic usage
Hook-driven inside a provider:
import { MicIndicator } from '@levelchat/react-components';
<MicIndicator participantId="user_42" />Or prop-driven for previews and static demos:
TypeScript (TSX)
<MicIndicator muted={false} surface="glass" size={28} />Headless hook
The styled component delegates to useMicState. Use the hook directly if you want to render your own chip:
import { useMicState } from '@levelchat/react-components';
function MyChip({ participantId }) {
const { muted } = useMicState({ participantId });
return <span>{muted ? 'OFF' : 'LIVE'}</span>;
}Theming
Two surface tiers cover the common contexts: glass for tile corners (semi-transparent backdrop over video) and plain for on-surface use (control bar). Both honour --lc-warning-solid / --lc-danger-solid for the muted state.
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
participantId | string | — | Hook-driven mode. Bypassed when muted is provided. |
muted | boolean | hook | Force the muted state. Wins over the hook. |
surface | 'glass' | 'plain' | glass | Backdrop tier — glass for over-video, plain for on-surface. |
size | number | 24 | Pixel size of the round chip. |
className | string | — | Pass-through class for extra layout/positioning. |
title | string | auto | Override the native tooltip text (defaults to "Muted" / "Live"). |