Staaarter

Member Inbox And Thread

A support/member-messaging inbox layout: a conversation list on the left with unread indicators, and the selected member's thread on the right with member/staff-styled message bubbles, timestamps, and a reply composer.

By Staaarter Team
Chat
Docs
Live preview

Docs

Installation

A real shadcn registry command, not a copy-paste stand-in: it fetches this block plus its avatar, avatar-initials, badge dependencies and any missing npm packages, and installs them straight into your project.

npx shadcn add https://staaarter.com/r/member-inbox-thread.json

Prefer not to use the CLI? Copy the source from the Code toggle above into src/components/blocks/chat/chat22.tsx instead.

Usage

The file also exports chat22Demo, the exact props behind the preview above. Spread it to get a working section in one line, then replace it with your own data.

import { Chat22, chat22Demo } from "@/components/blocks/chat/chat22";

export default function Page() {
  return <Chat22 {...chat22Demo} />;
}

Props

PropTypeDefaultDescription
conversationsChat22Conversation[]noneAll conversations shown in the left-hand list.
initialConversationIdstringundefinedConversation id selected by default; falls back to the first conversation.
classNamestringnoneExtra classes for the outer wrapper element.

Types

export interface Chat22Message {
  id: string;
  from: "member" | "staff";
  text: string;
  timestamp: string;
}

export interface Chat22Conversation {
  id: string;
  memberName: string;
  memberAvatar?: { src: string; alt: string };
  preview: string;
  unread: boolean;
  messages: Chat22Message[];
}

Behavior notes

  • Selecting a conversation in the left list is real client state (useState<selectedId>), clicking a row swaps the right pane to that conversation's fixed message list.
  • The unread dot per conversation is static demo data, it doesn't clear when a conversation is opened.
  • The reply composer input and send button are a decorative, non-functional preview, nothing is sent or appended to the thread.
  • Timestamps are fixed literal strings supplied as data, never computed with new Date().