Chat Window

Complete chat interface with messaging and typing indicators

SaaSChat

Overview

ChatWindow provides a complete real-time chat interface with message list, input field, typing indicators, reactions, and file attachments. It supports minimized state, admin permissions, pagination for older messages, and direct message conversations.

Usage

import { ChatWindow } from "@leanicon/web-builder-library/saas";

<ChatWindow
  conversation={{
    id: "conv-1",
    title: "Team Chat",
    participants: [
      { id: "user-1", name: "Alex", isOnline: true, role: "member" },
      { id: "user-2", name: "Maria", isOnline: true, role: "admin" },
    ],
    unreadCount: 0,
    status: "active",
    createdAt: new Date(),
    updatedAt: new Date(),
  }}
  messages={[
    {
      id: "1",
      senderId: "user-2",
      senderName: "Maria",
      content: "Hey!",
      timestamp: new Date(),
      readStatus: "read",
    },
    {
      id: "2",
      senderId: "user-1",
      senderName: "Alex",
      content: "Hi!",
      timestamp: new Date(),
      readStatus: "delivered",
    },
  ]}
  currentUserId="user-1"
  onSendMessage={(content) => console.log("Send:", content)}
/>;

Variants

Default

M

Q3 Roadmap Sync

Online

M
Maria Garcia30 minutes ago
Hey team! Quick sync on the Q3 roadmap.
A
Alex Johnson15 minutes ago
Sounds good! Design review is done.

Default (Dark)

M

Q3 Roadmap Sync

Online

M
Maria Garcia30 minutes ago
Hey team! Quick sync on the Q3 roadmap.
A
Alex Johnson15 minutes ago
Sounds good! Design review is done.

With Typing Indicator

M

Q3 Roadmap Sync

Online

M
Maria Garcia1 minute ago
Let me check on that...
Maria Garcia is typing

With Typing Indicator (Dark)

M

Q3 Roadmap Sync

Online

M
Maria Garcia1 minute ago
Let me check on that...
Maria Garcia is typing

Minimized

Q3 Roadmap Sync3

Minimized (Dark)

Q3 Roadmap Sync3

Direct Message

M

Maria Garcia

Online

M
Maria Garcia5 minutes ago
Hey, quick question about the PR.
A
Alex Johnson1 minute ago
Sure, what's up?

Props

NameTypeDefaultRequiredDescription
conversationChatConversation—YesCurrent conversation
messagesChatMessage[]—YesMessages to display
currentUserIdstring—YesCurrent user ID
onSendMessage(content: string, attachments?: File[] | undefined) => void—YesCallback when message is sent
onEditMessage((messageId: string, newContent: string) => void)—NoCallback when message is edited
onDeleteMessage((messageId: string) => void)—NoCallback when message is deleted
onReaction((messageId: string, emoji: string) => void)—NoCallback when reaction is added/removed
onOpenThread((messageId: string) => void)—NoCallback when thread is opened
onPinMessage((messageId: string, isPinned: boolean) => void)—NoCallback when message is pinned/unpinned
onTypingStart(() => void)—NoCallback when typing starts
onTypingStop(() => void)—NoCallback when typing stops
typingUsersTypingUser[][]NoCurrently typing users
onLoadMore(() => void)—NoCallback to load more messages (pagination)
isLoadingMorebooleanfalseNoWhether more messages are loading
hasMorebooleanfalseNoWhether there are more messages
isMinimizedbooleanfalseNoWhether chat is in minimized state
onToggleMinimize(() => void)—NoCallback to toggle minimized state
permissionsChatPermissions—NoPermission flags
classNamestring—NoAdditional CSS class names