A voice chat pill that morphs into a card showing everyone in the room.
Click the pill to open the room. The avatars glide out into a grid, the names fade in and anyone speaking gets a live level badge. Press Join now and your avatar pops into the grid, while the button turns into a mic toggle and a Leave button. Unmute to show your own level badge. Close it with the X button or Escape. Honors prefers-reduced-motion: the layout snaps and content cross-fades, and the level bars stop moving.
npx shadcn@latest add ikislay/pixel-ui/audio-chat-roomimport { AudioChatRoom } from "@/components/ui/audio-chat-room"const people = [{ id: "1", name: "Ana", avatar: "/ana.jpg", speaking: true },{ id: "2", name: "Sam" },]export function Demo() {return <AudioChatRoomparticipants={people}onJoin={() => {}}onLeave={() => {}}onMutedChange={(muted) => {}}/>}
1// Loading…
Options you can pass to customize this component.
participants*{ id: string; name: string; avatar?: string; speaking?: boolean }[]Who is in the room. The pill stacks the first 4 avatars and counts the rest. Without an avatar, initials show instead.
titlestringThe heading of the open card.
joinLabelstringText of the join button.
helperTextstringMuted line under the join button, before you join.
you{ id: string; name: string; avatar?: string }The avatar added to the grid when you join.
defaultMutedbooleanWhether your mic starts muted on join. Leaving resets it.
mutedTextstringThe line under the controls while you are muted.
liveTextstringThe line under the controls while your mic is on.
onJoin() => voidRuns when the join button is pressed.
onLeave() => voidRuns when the Leave button is pressed.
onMutedChange(muted: boolean) => voidRuns when the mic toggle is pressed.
expandedbooleanControls the open state. Pair it with onExpandedChange.
defaultExpandedbooleanStarts the room open when the state is not controlled.
onExpandedChange(expanded: boolean) => voidRuns when the room opens or closes.
Most components here are recreations of great work from around the web. I don't claim to be the original creator - this is my attempt to reverse-engineer, replicate, and often add a few extra features. I've tried to credit everyone; if I missed someone, let me know.
1
Mic will be muted initially.
You're in. Your mic is muted.
You're live. Everyone can hear you.