1.0.3 • Published 9 months ago

react-floating-whatsapp2 v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

React Floating Whatsapp2

Simple react component for adding a floating WhatsApp button to your project.

NPM npm bundle size GitHub

Install

npm

npm i react-floating-whatsapp2

Yarn

yarn add react-floating-whatsapp2

Usage

import React from 'react'
import { FloatingWhatsApp } from 'react-floating-whatsapp2'

export default function App() {

  return (
      <FloatingWhatsApp {/*  Props  */} />
  )
}

Props

PropTypeOptionsDescriptionDefault
phoneNumberStringRequiredPhone number in intenational format1234567890
accountNameStringRequiredAccount usernameAccount Name
onClickFunctionOptionalCallback function fires on click-
onSubmitFunctionOptionalCallback function fires on submit with event and form input value passed-
onCloseFunctionOptionalCallback function fires on close-
onLoopDoneFunctionOptionalCallback function called when notification loop done-
onNotificationFunctionOptionalCallback function fired when notification runs-
avatarStringOptionalChange user avatar using static assetsUI Face
statusMessageStringOptionalText below the account usernameTypically replies within 1 hour
chatMessageStringOptionalText inside the chat box.Hello there! 🤝 \nHow can we help?
placeholderStringOptionalInput placeholder.Type a message..
messageDelayNumberOptionalTime delay after which the chatMessage is displayed (in seconds).2
darkModeBooleanOptionalDark style.false
openChatOnClickBooleanOptionalopen the chat box if clicked on whatsApp icontrue
allowDefaultSubmitBooleanOptionalAllow default submit behavior of redirecting to whatsApp on submittrue
allowClickAwayBooleanOptionalCloses the chat box when user clicks outsidefalse
allowEscBooleanOptionalCloses the chat box when Escape key is pressedfalse
classNameStringOptionalCSS className applied to the main wrapping Divfloating-whatsapp
buttonClassNameStringOptionalCSS className applied to buttonfloating-whatsapp-button
styleCSSPropertiesOptionalInline style applied to the main wrapping Div{}
buttonStyleCSSPropertiesOptionalInline style applied to button{}
chatboxHeightNumberOptionalControl chat box height320
chatboxClassNameStringOptionalCSS className applied to chat boxfloating-whatsapp-chatbox
chatboxStyleCSSPropertiesOptionalInline style applied to chat box{}
notificationBooleanOptionalAllow notifications (Disabled after user open the chat box)false
notificationDelayNumberOptionalTime delay between notifications in seconds60
notificationSoundBooleanOptionalAllow notification soundfalse
notificationSoundSrcStringOptionalNotification sound custom src-
notificationLoopNumberOptionalRepeat notifications loop0
notificationStyleCSSPropertiesOptionalInline style applied to notification-
notificationClassNameStringOptionalCSS className applied to notification indicatorfloating-whatsapp-notification

Edit react-floating-whatsapp2

Credits

awran5

i forked this project because owner is inactive from last many months also need some extra functionality and more stability

License

MIT © AdarshHatkar