Coder Social home page Coder Social logo

darwinva97 / react-floating-whatsapp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from awran5/react-floating-whatsapp

0.0 0.0 1.0 2.67 MB

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

Home Page: https://react-floating-whatsapp.vercel.app/

License: MIT License

JavaScript 6.03% TypeScript 50.62% CSS 28.88% MDX 14.47%

react-floating-whatsapp's Introduction

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

Prop Type Options Description Default
phoneNumber String Required Phone number in intenational format 1234567890
accountName String Required Account username Account Name
onClick Function Optional Callback function fires on click -
onSubmit Function Optional Callback function fires on submit with event and form input value passed -
onClose Function Optional Callback function fires on close -
onLoopDone Function Optional Callback function called when notification loop done -
onNotification Function Optional Callback function fired when notification runs -
avatar String Optional Change user avatar using static assets UI Face
statusMessage String Optional Text below the account username Typically replies within 1 hour
chatMessage String Optional Text inside the chat box. Hello there! ๐Ÿค \nHow can we help?
placeholder String Optional Input placeholder. Type a message..
messageDelay Number Optional Time delay after which the chatMessage is displayed (in seconds). 2
darkMode Boolean Optional Dark style. false
allowClickAway Boolean Optional Closes the chat box when user clicks outside false
allowEsc Boolean Optional Closes the chat box when Escape key is pressed false
className String Optional CSS className applied to the main wrapping Div floating-whatsapp
buttonClassName String Optional CSS className applied to button floating-whatsapp-button
style CSSProperties Optional Inline style applied to the main wrapping Div {}
buttonStyle CSSProperties Optional Inline style applied to button {}
chatboxHeight Number Optional Control chat box height 320
chatboxClassName String Optional CSS className applied to chat box floating-whatsapp-chatbox
chatboxStyle CSSProperties Optional Inline style applied to chat box {}
notification Boolean Optional Allow notifications (Disabled after user open the chat box) false
notificationDelay Number Optional Time delay between notifications in seconds 60
notificationSound Boolean Optional Allow notification sound false
notificationSoundSrc String Optional Notification sound custom src -
notificationLoop Number Optional Repeat notifications loop 0
notificationStyle CSSProperties Optional Inline style applied to notification -
notificationClassName String Optional CSS className applied to notification indicator floating-whatsapp-notification

Edit react-floating-whatsapp

License

MIT ยฉ awran5

react-floating-whatsapp's People

Contributors

awran5 avatar chrisloarryn avatar manner avatar saiteja13427 avatar github-actions[bot] avatar semantic-release-bot avatar twistershark avatar darwinva97 avatar

Forkers

2003scott

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.