feedbackland-react
v2.12.1
Published
Drop-in React feedback widget. Slide-in drawer or popover; embeds a Feedbackland board via iframe (or your self-hosted instance) and submits feedback through a hosted API.
Maintainers
Readme
feedbackland-react
Drop a feedback button into your React app. A slide-in drawer or an anchored popover — your users post ideas, bugs, and requests without ever leaving your product.
Install
npm install feedbackland-reactUse
import { FeedbackButton } from "feedbackland-react";
export function App() {
return <FeedbackButton platformId="your-platform-id" />;
}That's the whole integration. The widget ships its own scoped styles — no CSS import, no provider, no setup.
Don't write this by hand. Create a board on feedbackland.com (free, MIT-licensed — or self-host the whole thing). Your admin panel's Widget page renders this exact snippet with your
platformIdpre-filled, alongside a live preview and interactive controls for every prop — copy straight from there.
Two flavors
// Drawer (default) — slide-in side panel with the full board.
<FeedbackButton platformId="..." />
// Popover — anchored inline form; user stays in flow.
<FeedbackButton platformId="..." widget="popover" />| | Drawer | Popover | | ------------ | --------------------------------------- | ------------------------------------------------- | | Layout | Slide-in side panel, full height | Anchored to the button, inline | | Mobile | Same drawer | Bottom sheet (auto via media query) | | What it shows | Your entire feedback board in an iframe | A single-shot submission form | | Use when | Feedback deserves a focused experience | Contextual, in-the-flow feedback |
Style it your way
The widget exposes four progressively more flexible ways to style the trigger button. Pick the one that fits.
1. Default styled button — sensible defaults:
<FeedbackButton platformId="..." text="Send feedback" variant="outline" size="lg" />2. Quick Tailwind override — tailwind-merge resolves conflicts, your classes win:
<FeedbackButton
platformId="..."
className="bg-red-500 hover:bg-red-600 rounded-full px-8"
/>3. Unstyled — strip every internal class, start from scratch:
<FeedbackButton
platformId="..."
variant="unstyled"
className="rounded-full bg-emerald-500 px-4 py-2 text-white hover:bg-emerald-600"
/>4. Bring your own button (asChild) — total control, Radix-style:
<FeedbackButton platformId="..." asChild>
<button className="any-classes-you-want">
<YourIcon /> Give feedback
</button>
</FeedbackButton>asChild merges the open handler into your child element, which keeps its own onClick, ref, and ARIA attributes.
Props
| Prop | Type | Default | Description |
| ------------- | --------------------------------------------------------------------------------------------- | -------------- | -------------------------------------------------------------------------------------------------------- |
| platformId | string (UUID) | required | Your organization ID — copy from the Widget admin page. |
| url | string | — | Override the board origin. Required only for self-hosted instances. |
| widget | "drawer" \| "popover" | "drawer" | Presentation flavor. |
| text | string | "Feedback" | Button label. Ignored when children is provided. |
| variant | "default" \| "secondary" \| "outline" \| "ghost" \| "link" \| "destructive" \| "unstyled" | "default" | Visual style preset. "unstyled" removes every internal class — pair with className. |
| size | "default" \| "sm" \| "lg" \| "icon" \| "icon-sm" \| "icon-lg" | "default" | Size preset. |
| className | ClassValue | — | Tailwind classes merged onto the trigger via tailwind-merge. Yours win conflicts with widget defaults. |
| asChild | boolean | false | When true, your child becomes the trigger directly. Requires a single React element child. |
| children | React.ReactNode | — | Trigger label (overrides text), or the trigger element itself when asChild is true. |
Self-hosted instances
Point the widget at your own Feedbackland deployment:
<FeedbackButton
platformId="your-platform-id"
url="https://your-board.example.com"
/>Self-hosting guide → SELFHOSTING.md.
Accessibility
- The drawer renders a proper
role="dialog"witharia-modal,aria-labelledby, and a visually hidden title. - Focus is trapped while open (
react-focus-on) and restored to the trigger on close. Escape closes the drawer. - The popover delegates focus management to Radix Popover / Drawer.
- The default trigger has full keyboard activation;
asChildpreserves your own element'sonClick,ref, and ARIA attributes via RadixSlot. - The shimmer skeleton shown while the iframe loads is
aria-hidden, so assistive tech doesn't announce decorative content.
Compatibility
- React 17 / 18 / 19 — peer dependencies only
- TypeScript — types included, strict-mode friendly
- SSR — safe with Next.js (App Router and Pages), Remix, Astro
- Browsers — modern evergreen (Chrome, Firefox, Safari, Edge); no IE11
- Node 18+ for tooling (the runtime is browser-only)
Under the hood
- Drawer opens a portal to
document.body, renders the full feedback board in an<iframe>pointing athttps://<platformId>.feedbackland.com(or yoururl), and traps focus withreact-focus-on. The iframe issandboxed for defense-in-depth. - Popover uses Radix Popover (desktop) / Radix Drawer (mobile) and
POSTs a single submission to/api/feedback/createon the board origin — no iframe, no board UI. - Style isolation in both directions — every Tailwind utility is prefixed
fl:, every CSS variable lives on.fl-scope. Nothing leaks out of the widget, nothing bleeds in from your host app. - CSS injected at runtime by JS — no separate stylesheet to import. The first widget instance per page injects a
<style>block; subsequent instances reuse it. - One
<link rel="preconnect">per board origin is added on mount and ref-counted across instances, so the iframe handshake is warm before the user clicks.
Bundle ≈ 110 KB gzipped (ESM, tree-shakable), including a full Tailwind 4 build, Radix Popover/Drawer, the scope reset, and the iframe error/timeout UI.
License
MIT © Feedbackland — fork it, run it, sell it.
