5.0.8 • Published 1 year ago

react-floating-whatsapp v5.0.8

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

React Floating Whatsapp

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

NPM npm bundle size GitHub

Install

npm

npm i react-floating-whatsapp

Yarn

yarn add react-floating-whatsapp

v5.0.0 - 2022-10-07

  • BREAKING CHANGES: change default import to name import
  • BREAKING CHANGES: rename height prop to chatboxHeight
  • BREAKING CHANGES: rename styles prop to style
  • BREAKING CHANGES: notificationDelay now in seconds instead of millisecond

Usage

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

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
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-whatsapp

License

MIT © awran5

5.0.6

2 years ago

5.0.5

2 years ago

5.0.4

2 years ago

5.0.2

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

5.0.8

1 year ago

5.0.7

1 year ago

4.0.5

3 years ago

4.0.4

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

4.0.2

3 years ago

3.0.0

3 years ago

2.1.0

3 years ago

1.5.1

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago