A lightweight, customizable WhatsApp chat widget for modern websites and web apps. Add a floating WhatsApp button, customize colors and messages, and let visitors contact you instantly.
Works with React, Next.js, TanStack Start, Vue, Svelte, Astro, and plain HTML.
- Floating WhatsApp chat button
- Fully customizable (colors, message, size, position)
- Zero dependencies
- Mobile‑friendly
- Works with all frameworks
- TypeScript support
- SEO‑friendly and lightweight
npm install whatsapp-website-chat-widget
# or
yarn add whatsapp-website-chat-widget
# or
pnpm add whatsapp-website-chat-widgetimport { WhatsAppWidget } from "whatsapp-website-chat-widget";
export default function App() {
return (
<WhatsAppWidget
phone="+1234567890"
message="Hello! I need help"
position="right"
color="#25D366"
size={56}
/>
);
}<script src="https://unpkg.com/whatsapp-website-chat-widget"></script>
<script>
WhatsAppWidget.init({
phone: "+1234567890",
message: "Hello!",
position: "right",
color: "#25D366",
});
</script>| Option | Type | Default | Description |
|---|---|---|---|
phone |
string | required | WhatsApp phone number (international format) |
message |
string | "" |
Prefilled message when chat opens |
position |
"left" | "right" |
"right" |
Widget position on screen |
color |
string | "#25D366" |
Button background color |
size |
number | 56 |
Button diameter in pixels |
(Add your widget screenshots here — Google ranks README images highly)
Example placeholders:
/screenshots/widget-light.png
/screenshots/widget-dark.png
This widget works out of the box with:
- React
- Next.js
- TanStack Start
- Vue
- Svelte
- Astro
- SolidJS
- Plain HTML
If you want, I can generate framework‑specific examples for each one.
Adding WhatsApp to your website improves:
- Customer support response time
- Conversion rates
- Trust and accessibility
- Mobile engagement
- Lead generation
Users prefer WhatsApp because it’s familiar, fast, and frictionless.
git clone https://github.com/alexasomba/whatsapp-website-chat-widget
cd whatsapp-website-chat-widget
npm install
npm run dev(Optional — add if you plan to include tests)
npm run build
npm publish- Dark mode auto‑detection
- Multi‑agent support
- WhatsApp Business API integration
- Analytics dashboard
- Custom icons
Contributions, issues, and feature requests are welcome!
Feel free to open a PR or issue.
MIT — free to use, modify, and distribute.
If this widget helps you, consider giving the repo a star on GitHub. It helps visibility and encourages continued development.