@talkjs/react-components
Version:
Provides chat UI components for TalkJS.
43 lines (28 loc) • 1.44 kB
Markdown
# React Components for TalkJS
The `/react-components` library provides React chat UI components for [TalkJS](https://talkjs.com).
## Prerequisites
To use this package, you will need a [TalkJS account](https://talkjs.com/dashboard/login). TalkJS provides a ready-to-use chat client for your application. Your account gives you access to TalkJS's free development environment.
## Examples
Install [`/react-components`](https://www.npmjs.com/package/@talkjs/react-components) and [`/core`](https://www.npmjs.com/package/@talkjs/core):
```sh
npm install /react-components @talkjs/core
# or
yarn add /react-components @talkjs/core
```
Import the `Chatbox` component and the related styling into the component where you want to have your chat UI:
```js
import { Chatbox } from "@talkjs/react-components";
import "@talkjs/react-components/default.css";
```
Then add the `Chatbox` component:
```js
<Chatbox
appId="<APP_ID>"
userId="sample_user_alice"
conversationId="sample_conversation"
/>
```
Replace the `<APP_ID>` with your TalkJS app ID, which you can find in the **Settings** tab of the TalkJS dashboard.
For more details, see our [React getting started guide](https://talkjs.com/docs/UI_Components/React/).
## Support
If you encounter any problems with `/react-components`, please open a [chat with support](https://talkjs.com/?chat). TalkJS support is staffed by engineers.