Chat Platform
The Stream Manager's platform vocabulary. One name per platform, its 20 px mark in its brand tint, and a destination's chat state in the words every window shares.
- YouTube
- Twitch
- X
- TikTok
- Custom RTMP
Installation
$ pnpm dlx shadcn@latest add @videorc/chat-platformUsage
import {
CHAT_PLATFORM_LABELS,
ChatPlatformIcon,
chatStateLabel,
} from "@/components/blocks/stream-manager/chat-platform";<ChatPlatformIcon platform="twitch" />Every Stream Manager part names a platform through it: a message's mark, the filter chips, the stats' hover cards and the status bar's chat states. Pass decorative when the words beside the mark already name the platform.
Examples
Chat states
chatStateLabel(destination) turns a destination's connection into Videorc's chat vocabulary: "Connected", "Read-only", "Reconnect to send", "Reconnecting…". It never says "receive-only", and never shows a raw value.
- YouTubeConnected
- TwitchReconnect to send
- XRead-only
- TikTokReconnecting…
The marks
Platform marks are the one place saturated colour is allowed in the chrome. Each mark is 20 px wherever it appears: YouTube's icon may not go below 20 px, so the others match it, and YouTube keeps clear space after it. A surface with no room for 20 px, such as a Badge, leaves the mark out and keeps the platform's name. The glyphs come from Icons (YoutubeIcon, TwitchIcon, XPlatformIcon…), so swapping one there swaps it here.
Theming
| Token or attribute | Meaning |
|---|---|
text-platform-youtube, text-platform-twitch-ink, text-platform-facebook, text-platform-instagram | The brand tints |
text-foreground | X and TikTok: black or white by theme |
size-5 | The 20 px mark |
data-platform | The platform the mark stands for |
data-slot="chat-platform-icon" | The mark |
Accessibility
A mark is an image named by its platform. With decorative it's hidden from assistive tech, so the platform is named once.
API reference
ChatPlatformIcon
Prop
Type
ChatDestination
Prop
Type
CHAT_PLATFORM_LABELS maps each platform to its one name ("X", never "X / Twitter"; "Custom RTMP", never "Custom").
Platform Filter
The one platform filter for the Stream Manager's chat and Activity. An All chip and a chip per platform mark, and the same choice as radio items for a Filters menu. Nothing at all with one platform.
Hooks and libs
The small pieces videorc/ui components share. Accelerators, platform glyphs, the modal check, the theme toggle and reduced motion.