Socket
Socket
Sign inDemoInstall

@harisenin/react-floating-whatsapp

Package Overview
Dependencies
9
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @harisenin/react-floating-whatsapp

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


Version published
Weekly downloads
7
increased by600%
Maintainers
1
Install size
628 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

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

Keywords

FAQs

Last updated on 18 Aug 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