A simple lightweight chat ui template component build react.
You must set required props for this to function.
IMPORTANT: your server must emit to 'receive' and listen to 'send' at your socket endpoint.
import Chatbot from 'react-webchat'
function App() {
return (
<>
<Chatbot
endpoint={'http://localhost:5000'}
iconSize='50'
brandColor='#248ec2'
brandColor2='#20365F'
title='React Webchat'
/>
</>
);
}
export default App;
Props:
- endpoint: string //Required - your server Websocket endpoint, this is built for Socket.io
- iconSize: string //Required - size in pixels of your chat icon
- brandColor: string //Required - set your brand colors, will accept normal css color values as a string
- brandColor2: string //Required - as above
- title: string //Required - the title of the component, this is shown in header section
React Socket Typescript