A modern, customizable React chat component library that provides a complete chat interface with support for messages, sidebars, and custom styling.
- React 18 or higher
- Styled Components 6 or higher
- React Markdown 9 or higher
- React Syntax Highlighter 15 or higher
npm install react-chat
# or
yarn add react-chat
# or
pnpm add react-chat
import { Chat, Messages, MessageInput, Sidebar } from 'react-chat';
const MyChat = () => (
<Chat>
<Messages />
</Chat>
);
const MyChat = () => (
<Chat>
<Messages />
<MessageInput />
</Chat>
);
const MyChat = () => (
<Chat>
<Sidebar />
<Messages />
<MessageInput />
</Chat>
);
const ChatWithToggle = () => (
<Chat>
<Sidebar withToggle={true} />
<Messages />
<MessageInput />
</Chat>
);
const ChatWithoutToggle = () => (
<Chat>
<Sidebar withToggle={false} />
<Messages />
<MessageInput />
</Chat>
);
const BasicChat = () => (
<Chat>
<Messages />
<MessageInput />
</Chat>
);
const CustomIconChat = () => (
<Chat
assistantIcon={<img src="/custom-assistant-icon.png" alt="Assistant" />}
>
<Sidebar />
<Messages />
<MessageInput />
</Chat>
);