react-faq-base
v1.11.0
Published
React base for faq bot
Downloads
11
Readme
React FAQ Base
This is a base chat library for FAQ bots.
Installation
yarn add react-faq-base
Usage
- Add component and pass props as listed below.
import React, { Component } from "react";
import Chat from "react-faq-base";
class Example extends Component {
render() {
return (
<Chat
base_url="http://my-backend-url"
initial_messages={["Hi, I am FAQ bot", "Powered by AI"]}
bot_name="Bot Foo"
primary_color="#fff"
reset={"/reset"}
/>
);
}
}
Props
| Property | Description | Type | Required | | ---------------- | ---------------------------------------------------------- | ------ | -------- | | base_url | URL to the backend | http | true | | initial_messages | Welcome messages to greet the user | Array | true | | bot_name | Name of the bot displayed in the chat header | String | true | | primary_color | Primary color for the chat window | Hex | false | | bot_src | Bot icon displayed in chat header and below bot's messages | http | false | | bot_inverted | Bot icon displayed inside toggle button | http | false | | reset | command to fire on reset button is clicked | String | false |