LiveBadge is the pulsing red LIVE pip used on broadcast surfaces — a tile corner, a webinar page header, the recording dashboard. Three sizes, optional viewer count, optional recording-active dot. Pure visual; no SDK wiring.
Install
pnpm add @levelchat/react-componentsRequirements
- 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 { LiveBadge } from '@levelchat/react-components';
<LiveBadge live size="md" viewerCount={1242} recording />Sizes
sm— chip-size, for tile corners.md— default, for header strips.lg— hero, for landing-page mocks + recording dashboards.
Props
| Prop | Type | Default | Notes |
|---|---|---|---|
live | boolean | — | Required. When false the badge shows its "Ended" state. |
size | 'sm' | 'md' | 'lg' | md | Visual size step. |
viewerCount | number | — | Optional viewer count rendered next to the pip. |
recording | boolean | false | Render the secondary "recording active" dot. |