react-whatsapp-float
v1.0.4
Published
A floating WhatsApp button component for React/Next.js
Downloads
442
Maintainers
Readme
React WhatsApp Float
A simple, customizable floating WhatsApp button component for React and Next.js applications.
Installation
npm install react-whatsapp-floatUsage
Basic Usage
import { WhatsAppFloat } from 'react-whatsapp-float';
function App() {
return (
<div>
<WhatsAppFloat phoneNumber="+254710858995
" />
</div>
);
}With Custom Message
<WhatsAppFloat
phoneNumber="+254710858995"
message="Hi! I'm interested in your services"
/>Custom Position and Size
<WhatsAppFloat
phoneNumber="+254710858995"
message="Hello!"
position="left"
size={70}
/>Props
| Prop | Type | Default | Description | |------|------|---------|-------------| | phoneNumber | string | required | WhatsApp phone number with country code | | message | string | "Hello! I would like to know more about your services." | Pre-filled message | | position | 'left' | 'right' | 'right' | Position of the floating button | | size | number | 60 | Size of the button in pixels |
License
MIT
