react-chat-initd-widget
v1.0.4
Published
Reusable React chat widget with WebSocket support
Downloads
32
Maintainers
Readme
react-chat-initd-widget
A lightweight, responsive React chat widget powered by WebSockets. Easily embed a chatbot into your app with customizable welcome messages and a dynamic WebSocket URL.
✨ Features
- 🎯 WebSocket-based real-time chat
- 💬 Customizable welcome message
- ⚡ Fully responsive design with Tailwind CSS
- 🧩 Easy integration into any React app
- 🛠️ Minimal dependencies
📦 Installation
npm install react-chat-initd-widget
Peer dependencies: You must have react, react-dom, and tailwindcss installed in your project.
🚀 Usage
import React from "react";
import ChatWidget from "react-chat-widget";
export default function App() {
return (
<div className="flex justify-end items-end min-h-screen p-4 bg-gray-50">
<ChatWidget
socketUrl="ws://localhost:8000/ws/chat"
welcomeMessage="👋 Hello! How can I help you today?"
/>
</div>
);
}