4.0.16 • Published 2 years ago

@harisenin/react-floating-whatsapp v4.0.16

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

Changes

  • Added: Default Avatar using generated random avatars
  • Added: New Prop height that allow to control the chat box height.
  • Added: New Prop notification that enable/disable repeated notifications sound and indicators.
  • Added: New Prop notificationDelay to set the time delay between notifications in millisecond.
  • Added: New Prop notificationSound to allow notifications sound.
  • Added: Message typing effect before chatMessage appears.
  • Fixed: Chat box css position Thanks to @jpmedeirosmorais and @jorgemndoza
  • Modified: Refactor state using useReducer Hook.
  • Modified: Prevent toggle open/close the chat box.
  • Modified: CSS stylesheet import, now its applied inline.
  • Updated: App dependencies

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
avatarStringOptionalChange user avatar using static assetsUI Faces
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..
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 Divcustom-class
stylesCSSPropertiesOptionalInline style applied to the Button only{}
heightNumberOptionalControl chat box height300
notificationBooleanOptionalAllow repeated notifications (Disabled after user opens the chat box)false
notificationDelayNumberOptionalTime delay between notifications in millisecond18000
notificationSoundBooleanOptionalAllow notification soundfalse

Edit react-floating-whatsapp

License

MIT © awran5

4.0.16

2 years ago

4.0.15

3 years ago

4.0.14

3 years ago

4.0.13

3 years ago

4.0.12

3 years ago

4.0.11

3 years ago

4.0.10

3 years ago

4.0.9

3 years ago

4.0.8

3 years ago

4.0.7

3 years ago

1.0.0

3 years ago

1.0.1

3 years ago