Add a beautiful WhatsApp chat button to any website in seconds
Add this single line to your HTML, just before the closing </body> tag:
1234567890"
data-header-title="Your Business Name"
data-message="Hi! How can I help you?"
></script>
Note: Replace the phone number with your WhatsApp number (include country code without + or spaces)
Change colors, text, position, and branding to match your brand
Works perfectly on mobile, tablet, and desktop devices
No dependencies, pure vanilla JavaScript and CSS
Just one script tag - no complex setup required
Keyboard navigation and screen reader support
Works on all modern browsers including mobile
Customize the widget using data attributes on the script tag:
| Attribute | Description | Default |
|---|---|---|
data-phone |
WhatsApp phone number (required, with country code) | - |
data-header-title |
Chat window header title | "Chat with us" |
data-header-subtitle |
Status text below title | "Online" |
data-message |
Pre-filled message in chat | "Hi! How can I help you?" |
data-button-text |
Text on the "Start chat" button | "Start chat" |
data-position |
Button position: bottom-right, bottom-left, top-right, top-left | "bottom-right" |
data-theme-color |
Primary color (hex code) | "#4DC247" |
data-branding |
Show branding text (true/false) | "true" |
data-branding-text |
Custom branding text | "Powered by WhatsApp Widget" |
data-branding-url |
URL for branding link | "" |
To use this widget in production:
whatsapp-widget.js and whatsapp-widget.css to your web server or CDN
The widget works on all modern browsers: