pa-floating-window
v1.0.0
Published
A plug-and-play React floating window widget for feature requests and feedback.
Maintainers
Readme
pa-floating-window
A plug-and-play React floating window widget for feature requests and feedback. Zero configuration, completely unstyled out of the box so it just works!
Installation
npm install pa-floating-window
# or
yarn add pa-floating-windowUsage
Simply import the FeedbackWidget into your layout or app root and pass your API endpoint where you want the feedback to be sent.
import { FeedbackWidget } from 'pa-floating-window';
export default function App() {
return (
<div>
<h1>My Application</h1>
{/* Add the widget anywhere in your dom, it will float automatically */}
<FeedbackWidget
apiUrl="https://your-hackbyte-deployment.vercel.app/api/feedback"
primaryColor="#3b82f6" // Optional: customize the main theme color
/>
</div>
);
}Props
| Prop | Type | Default | Description |
| ---- | ---- | ------- | ----------- |
| apiUrl | string | Required | The absolute URL of your REST API to send the POST request to. |
| primaryColor | string | #3b82f6 | Optional hex/rgb value to change the base color of the button and action button. |
payload structure
The widget will send a POST request to your apiUrl containing the following JSON structure:
{
"title": "Dark Mode Support",
"description": "It would be great if the app had a dark mode.",
"email": "[email protected]"
}