Socket
Socket
Sign inDemoInstall

react-floating-whatsapp

Package Overview
Dependencies
5
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-floating-whatsapp

Simple React Component for adding a floating WhatsApp button to your project.


Version published
Weekly downloads
1.9K
increased by5.9%
Maintainers
1
Install size
327 kB
Created
Weekly downloads
 

Readme

Source

React Floating Whatsapp

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

NPM npm bundle size GitHub

screenshot

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

Keywords

FAQs

Last updated on 31 Dec 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc