npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, πŸ‘‹, I’m Ryan HefnerΒ  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you πŸ™

Β© 2025 – Pkg Stats / Ryan Hefner

@dxkit-org/react-floating-whatsapp

v1.0.9

Published

πŸš€ Fully customizable React WhatsApp floating button component with TypeScript support, dark mode, notifications, and seamless WhatsApp integration for modern web applications

Downloads

278

Readme

React Floating WhatsApp Component πŸ’¬

The most customizable and feature-rich React WhatsApp floating button component - Add professional WhatsApp integration to your website with TypeScript support, dark mode, notifications, and seamless user experience.

NPM Version Bundle Size Downloads License TypeScript

🌟 Why Choose React Floating WhatsApp?

Perfect for e-commerce, customer support, lead generation, and business websites that need instant customer communication. Used by thousands of developers worldwide!

πŸš€ Quick Installation & Setup

NPM Installation

npm install @dxkit-org/react-floating-whatsapp

Yarn Installation

yarn add @dxkit-org/react-floating-whatsapp

PNPM Installation

pnpm add @dxkit-org/react-floating-whatsapp

πŸ’» Basic Usage Example

Get started in seconds with this simple implementation:

import React from 'react'
import { FloatingWhatsApp } from '@dxkit-org/react-floating-whatsapp'

export default function App() {
  return (
    <FloatingWhatsApp
      phoneNumber='1234567890'
      accountName='Your Business'
      avatar='/path/to/avatar.jpg'
      statusMessage='Typically replies within 1 hour'
      chatMessage='Hello! πŸ‘‹ How can we help you today?'
      darkMode={false}
      allowClickAway={true}
      allowEsc={true}
      notification={true}
      notificationSound={true}
    />
  )
}

🎨 Advanced Usage with Custom Styling

import React from 'react'
import { FloatingWhatsApp } from '@dxkit-org/react-floating-whatsapp'

export default function App() {
  const handleSubmit = (event, message) => {
    console.log('Message sent:', message)
    // Add your custom logic here
  }

  return (
    <FloatingWhatsApp
      phoneNumber='1234567890'
      accountName='Customer Support'
      onSubmit={handleSubmit}
      className='custom-whatsapp-widget'
      buttonStyle={{ backgroundColor: '#25D366' }}
      chatboxStyle={{ borderRadius: '20px' }}
      darkMode={true}
      notification={true}
      notificationDelay={30}
    />
  )
}

πŸ“‹ Complete API Reference & Props

Customize every aspect of your WhatsApp widget with these comprehensive 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 | | openChatOnClick | Boolean | Optional | open the chat box if clicked on whatsApp icon | true | | allowDefaultSubmit | Boolean | Optional | Allow default submit behavior of redirecting to whatsApp on submit | true | | 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 |

🎯 Live Demo & Playground

Edit react-floating-whatsapp

Try it live on CodeSandbox and see all features in action!

✨ Key Features & Benefits

  • πŸš€ Zero Configuration - Works out of the box with minimal setup
  • πŸ’Ό Full TypeScript Support - Complete type safety and IntelliSense
  • 🎨 Highly Customizable - Custom styling with CSS classes and inline styles
  • πŸŒ™ Dark/Light Mode - Built-in theme switching capability
  • πŸ”” Smart Notifications - Configurable notification system with sound support
  • πŸ“± Mobile Responsive - Perfect on all devices and screen sizes
  • ⌨️ Accessibility Ready - Full keyboard navigation and ESC key support
  • πŸ–±οΈ Click Outside to Close - Intuitive user interaction patterns
  • 🎯 Event Callbacks - Hook into click, submit, close, and notification events
  • πŸ“ž Direct WhatsApp Integration - Seamless connection to WhatsApp Web/App
  • ⚑ Lightweight - Minimal bundle size impact on your application
  • πŸ”§ Framework Agnostic - Works with Next.js, Gatsby, CRA, and more

🏒 Perfect For

  • E-commerce Websites - Instant customer support and sales assistance
  • Business Websites - Lead generation and customer inquiries
  • Service Providers - Quick booking and consultation requests
  • SaaS Applications - User support and onboarding assistance
  • Portfolio Sites - Direct client communication
  • Landing Pages - Convert visitors into leads

🌐 Browser Support

  • βœ… Chrome (Latest)
  • βœ… Firefox (Latest)
  • βœ… Safari (Latest)
  • βœ… Edge (Latest)
  • βœ… Mobile browsers (iOS Safari, Chrome Mobile)

πŸ“¦ What's Included

  • React component with TypeScript definitions
  • Default avatars and sound files
  • CSS modules for styling
  • Comprehensive documentation
  • Live examples and demos

🀝 Contributing & Support

We welcome contributions! Please see our Contributing Guide for details.

πŸ“Š NPM Stats

  • Weekly Downloads: Growing rapidly
  • Bundle Size: Lightweight and optimized
  • Dependencies: Minimal peer dependencies (React 18+)
  • TypeScript: Full type coverage

πŸ”— Related Packages

Looking for more React components? Check out our other packages:

  • @dxkit-org/react-components - Complete UI component library
  • More coming soon!

⭐ Show Your Support

If this package helped you, please consider:

  • ⭐ Starring the GitHub repository
  • 🐦 Sharing on Twitter with #ReactFloatingWhatsApp
  • πŸ“ Writing a review or blog post
  • 🀝 Contributing to the project

πŸ™ Credits & Acknowledgments

This project is forked from awran5/react-floating-whatsapp with significant enhancements including:

  • TypeScript improvements
  • Additional customization options
  • Enhanced notification system
  • Better accessibility
  • Improved documentation
  • Bug fixes and stability improvements

Special thanks to all contributors and the React community!

πŸ“„ License

MIT Β© dxkit-org


Made with ❀️ by the dxkit-org team

Website β€’ Twitter β€’ GitHub

Don't forget to ⭐ star this repository if it helped you!