Skip to content
Blobz docs

Group Chat

A conversation panel with avatars for messages, members, and typing presence.

release
  1. Janaki Ammal

    The new avatars are live. Every account has one now.

  2. Vikram Sarabhai

    Generated from the name?

  3. Kalpana Chawla

    Same name, same face, every time.

  4. Srinivasa Ramanujan

    That makes staging and production feel like the same place.

  5. Vikram Sarabhai is typing
View code
group-chat-example.tsx
import {
	GroupChat,
	type GroupChatPerson,
} from "@/components/blobz/group-chat";

const PARTICIPANTS = [
	{
		avatar: {
			name: "Janaki",
			palette: ["#dff4ff", "#38bdf8"],
		},
		id: "janaki",
		name: "Janaki Ammal",
	},
	{
		avatar: {
			name: "Vikram",
			palette: ["#fff0e2", "#fa9769"],
		},
		id: "vikram",
		name: "Vikram Sarabhai",
	},
	{
		avatar: {
			name: "Kalpana",
			palette: ["#e7fbe8", "#9ce786"],
		},
		id: "kalpana",
		name: "Kalpana Chawla",
	},
	{
		avatar: {
			name: "Srinivasa",
			palette: ["#f4e7ff", "#c994ec"],
		},
		id: "srinivasa",
		name: "Srinivasa Ramanujan",
	},
	{
		avatar: {
			name: "Gagandeep",
			palette: ["#fff0e2", "#efa973"],
		},
		id: "gagandeep",
		name: "Gagandeep Kang",
	},
] as const satisfies readonly GroupChatPerson[];

const MESSAGES = [
	{
		author: PARTICIPANTS[0],
		id: "1",
		text: "The new avatars are live. Every account has one now.",
		time: "9:41",
	},
	{
		author: PARTICIPANTS[1],
		id: "2",
		text: "Generated from the name?",
		time: "9:42",
	},
	{
		author: PARTICIPANTS[2],
		id: "3",
		text: "Same name, same face, every time.",
		time: "9:43",
	},
	{
		author: PARTICIPANTS[3],
		id: "4",
		text: "That makes staging and production feel like the same place.",
		time: "9:44",
	},
] as const;

export function GroupChatExample() {
	return (
		<GroupChat
			channel="release"
			className="max-w-2xl"
			messages={MESSAGES}
			participants={PARTICIPANTS}
			typing={PARTICIPANTS[1]}
		/>
	);
}

Installation

npx shadcn@latest add @blobz/group-chat

The avatar and avatar group components are installed automatically.

Usage

import { GroupChat } from "@/components/blobz/group-chat";

<GroupChat
  channel="release"
  participants={[{ id: "janaki", name: "Janaki Ammal", avatar: { name: "Janaki" } }]}
  messages={[{ id: "1", author: { id: "janaki", name: "Janaki Ammal", avatar: { name: "Janaki" } }, time: "9:41", text: "The new avatars are live." }]}
/>

Pass a typing person to show the live typing row. Message text is rendered as plain text, with line breaks preserved.

The avatar source accepts a stable name and optional src, frame, palette, and choices. Images automatically fall back to the generated face.

Theme

On this page