videorc/ui

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
  • Instagram
  • Facebook
  • Custom RTMP

Installation

$ pnpm dlx shadcn@latest add @videorc/chat-platform

Usage

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 attributeMeaning
text-platform-youtube, text-platform-twitch-ink, text-platform-facebook, text-platform-instagramThe brand tints
text-foregroundX and TikTok: black or white by theme
size-5The 20 px mark
data-platformThe 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").