1.1.6 ā€¢ Published 1 year ago

react-whatsapp-chat-widget v1.1.6

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

react-whatsapp-chat-widget

npm version Ā  License: MIT

This is a Whatsapp Chat Widget for react where you can use as a plugin in your react project with full customization of your own.

Getting Started

npm install react-whatsapp-chat-widget
# or
yarn add react-whatsapp-chat-widget

āš ļø If you get "Uncaught SyntaxError: Cannot use import statement outside a module" when importing ECMAScript 6, then your app must be SSR enabled like in NextJS. To resolve the issue in nextJS visit here

For demo

Visit our site to see react-whatsapp-chat-widget live performance

Usage

import React from "react";

import WhatsAppWidget from "react-whatsapp-chat-widget";
import "react-whatsapp-chat-widget/index.css";

const ReactApp = () => {
	return (
		<WhatsAppWidget
			phoneNo="919884098840"
			position="right"
			widgetWidth="300px"
			widgetWidthMobile="260px"
			autoOpen={true}
			autoOpenTimer={5000}
			messageBox={true}
			messageBoxTxt="Hi Team, is there any related service available ?"
			iconSize="40"
			iconColor="white"
			iconBgColor="tomato"
			headerIcon="https://www.pdapps.net.in/_next/static/media/android-chrome-192x192.9a39c2c7.png"
			headerIconColor="pink"
			headerTxtColor="black"
			headerBgColor="tomato"
			headerTitle="John Doe"
			headerCaption="Online"
			bodyBgColor="#bbb"
			chatPersonName="Support"
			chatMessage={<>Hi there šŸ‘‹ <br /><br /> How can I help you?</>}
			footerBgColor="#999"
			placeholder="Type a message.."
			btnBgColor="yellow"
			btnTxt="Start Chat"
			btnTxtColor="black"
		/>
	);
};

export default ReactApp;

āš ļø The phoneNo is a full phone number in international format. Omit any zeroes, brackets, or dashes when adding the phone number in international format.

Example: 919884098840 where 91 is the International code for India.

PropertyTypeDefaultDescription
phoneNostring''WhatsApp international no. which will receive the message.
positionstring'right'Position the widget to left bottom or right bottom (Enum 'left', 'right')
widgetWidthstring'300px'Width of the entire widget for devices more than '360px' width
widgetWidthMobilestring'260px'Width of the entire widget for devices less than '360px' width like mobile devices
autoOpenboolean'false'Open the chat box automatically
autoOpenTimerstring, number3000 in millisecondsSet timer to open the chat box automatically
messageBoxbooleanfalseMessage box is hidden by default, so you can enable it if needed
messageBoxTxtstring''If Message box is enabled, you can put the default text for the user to start up with the conversation
iconSizestring'52'Fix the size of the chat icon
iconColorstring'rgb(37, 211, 102)'Chat icon color (HexCode, RGB format)
iconBgColorstring'#ffffff'Chat icon background color (HexCode, RGB format)
headerIconstringreactNode svg iconProfile icon in the header as a profile image or use the default svg icon (image uri see the example above)
headerIconColorstring'rgb(100, 100, 100)'Profile icon color in the header (this works only when default svg icon is used)
headerTxtColorstring'rgb(255, 255, 255)'Header text color
headerBgColorstring'rgb(7, 94, 84)'Header background color
headerTitlestring'Customer Support'Header title
headerCaptionstringOnlineHeader caption
bodyBgColorstring'rgb(227, 220, 213)'Chat body background color
chatPersonNamestring'Support'Person name in the chat bubble
chatMessagereactNode<>Hi there šŸ‘‹ <br /><br /> How can I help you?</>Message text in the chat bubble
footerBgColorstring'rgb(255, 255, 255)'Footer background color
placeholderstringType a message..Placeholder for text input
btnBgColorstring'rgb(79, 206, 93)'Start chat button background color
btnTxtstring'rgb(255, 255, 255)'Start chat button text
btnTxtColorstring'rgb(255, 255, 255)'Start chat button text color

License

MIT

Created by

Proficient Designers proficientdesigners.com

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

2 years ago

1.1.0

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago