Skip to content

Getting Started

react-actions-chat gives you a chat UI plus the primitives needed to turn messages into guided actions.

Install

bash
npm install react-actions-chat

This package targets Node.js 22.13.0+.

Import the bundled styles anywhere you mount the chat:

tsx
import 'react-actions-chat/styles';

First Chat

tsx
import { Chat } from 'react-actions-chat';
import 'react-actions-chat/styles';

export function App() {
  return (
    <Chat
      theme='dark'
      initialMessages={[
        {
          type: 'other',
          content: 'Hello! How can I help you today?',
        },
      ]}
    />
  );
}

initialMessages seeds the conversation when the component first mounts. Each message is either from the local user (self) or the assistant side (other).

Companion Package

Install the companion package if you want recommended actions driven by a search query or vector search:

bash
npm install react-actions-chat react-actions-chat-recommended-actions

Then continue with Recommended actions overview.