npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-chat-window-pro

v1.1.0

Published

A chatbot window for React lets you connect with a chatbot and customise the appearance of the chat

Downloads

4

Readme

Chat window for React Js

A chatbot window for React Js lets you connect with a chatbot and customise the appearance of the chat with mutiple themes and various type of responses.

Table of Contents:

Getting Started

How To Install

In React Js

To use the chat window in a react js project, first install the package using npm:

npm install react-chat-window-pro

Import Package

To use the TypeScript definition files within a Node.js project, simply import aws-sdk as you normally would.

In a TypeScript file:

// import chat window package 
import ChatWindow from 'react-chat-window-pro'

What's New

  • Read Receipt
  • Stacked Quick Reply
  • Chat Window Sizing (small, medium, large)
  • IsConnected Loader

Get Chat Window

Chat window support mutiple type of responses and themes

Add Chat window component:

<ChatWindow
        theme="blue"
        title="Chat help"
        messages={messageData}
        isConnected={isConnected}
        handleUserResponse={handleUserMessage}
        handleClose={handleChatClose}
        windowSize={"large"} />

Available Themes

  • blue
  • green
  • orange
  • brown

Various Responses

  • Text
  • Quick Replies
  • Message with buttons
  • Image Card
  • Card Carousel

Text

Simple text message from agent or bot

{
  sender: "Bot", //Sender Name
  timestamp: "12:00", //Message Time stamp
  type: "text", //Type of message
  isMe: false,
  data: {
    text: "Hi, welcome to react chat window prod!"
  },
}

Quick Replies

Quick replies list with message to perform quick messaging with user

{
  sender: "Bot", //Sender Name
  timestamp: "12:00", //Message Time stamp
  type: "quickreplies", //Type of Message
  isMe: false,
  //Message before quick replies
  data: {
    text: "I am quick reply."
  },
  isClicked: false,
  //List of quick replies
  quickReplies: [
    {
      title: 'Buy',
      response: 'buy'
    },
    {
      title: 'Sell',
      response: 'Sell'
    },
    {
      title: 'Quick Reply',
      response: 'I am quick reply'
    },
    {
      title: 'Add to cart',
      response: 'add to cart'
    },
    {
      title: 'go to cart',
      response: 'go to cart'
    },
  ]
}

Stacked Quick Replies

{
	sender: "Bot", //Sender Name
  	timestamp: "12:00", //Message Time stamp
  	type: "card", //Type of Message
  	isMe: false,  
  	isClicked: false,
	data: {
		title: "I am Stacked Quick Reply", //This message show in bold
		subititle: "I am Subtitle", //This message shows in normal
		//List of buttons with link
		buttons: [
			{
				action: "quickreply",
				title: "Buy",
				response: "Buy"
			},
			{
				action: "quickreply",
				title: "Add to Cart",
				response: "Add to cart"
			}
		]
	}
}

Message with buttons

Message with buttons will redirect user to given url

{
	sender: "Bot", //Sender Name
  	timestamp: "12:00", //Message Time stamp
  	type: "card", //Type of Message
  	isMe: false,  
  	isClicked: false,
	data: [{
		title: "I am title", //This message show in bold
		subititle: "I am Subtitle", //This message shows in normal
		//List of buttons with link
		buttons: [
			{
				action: "link",
				title: "Buy",
				tooltip: "Buy this product with 20% discount",
				url: "http://myurl"
			},
			{
				action: "link",
				title: "Add to Cart",
				tooltip: "Add this product to cart",
				url: "http://myurl"
			}
		]
	}]
}

Image Card

Show message and image in chat window

{
	sender: "Bot", //Sender Name
  	timestamp: "12:00", //Message Time stamp
  	type: "card", //Type of Message
  	isMe: false,  
  	isClicked: false,
	data:[ 
	{
		title: "I am title", //This message show in bold
		subititle: "I am Subtitle", //This message shows in normal
		//Media object with Image type and url
		media: {
			type: "image",
			url: "https://image.flaticon.com/icons/svg/145/145867.svg",
		},		
  }]
},

Card Carousel

Show carousel of cards so use can choose from mutiple options

{
	sender: "Bot", //Sender Name
  	timestamp: "12:00", //Message Time stamp
  	type: "card", //Type of Message
  	isMe: false,  
  	isClicked: false,
	data:[
	{
		title: "I am Card 1",
		subititle: "I am Subtitle",
		media: {
			type: "image",
			url: "https://image.flaticon.com/icons/svg/145/145867.svg",
		},
		buttons: [
			{
				action: "link",
				title: "Buy",
				tooltip: "Buy this product with 20% discount",
				url: "http://myurl"
			}
		]
	},
	{
		title: "I am Card 2",
		subititle: "I am Subtitle",
		media: {
			type: "image",
			url: "https://image.flaticon.com/icons/svg/145/145867.svg",
		},
		buttons: [
			{
				action: "link",
				title: "Buy",
				tooltip: "Buy this product with 20% discount",
				url: "http://myurl"
			}			
		]
	}]
}

Sample

React chat window pro have mutiple feature to interact with user efficiently

  • Simple Text with brown theme

Simple Text

  • Card carosel with buttons, text and image in green theme

Card carosel

  • Image Card carosel

Card carosel

  • Quick replies with blue theme

Quick replies

  • Chat connection loader

Quick replies

Upcoming

Adding new features to chat window

  • Typing Indicator
  • Delays in messages
  • Mutiple Chat bubble
  • Print Chat
  • High Important
  • Chat bubble positions
  • More Theme options
  • Emojis
  • Video card with inline video player
  • Map Cards
  • Graph Cards
  • Attachement options