Feedtack

FeedtackProvider is the root component that enables Feedtack in your application. It renders the feedback button, modal, pin overlay, comment form, and thread panel.

import { FeedtackProvider } from "feedtack/react";

Props

Required

PropTypeDescription
childrenReactNodeYour application
adapterFeedtackAdapterBackend adapter for persistence
currentUserFeedtackUserThe currently logged-in user

Optional

PropTypeDefaultDescription
hotkeystring"p"Key for the keyboard shortcut (Shift+{hotkey})
adminOnlybooleanfalseOnly show the feedback button to users with role === "admin"
themeFeedtackTheme—Override default styling via CSS custom properties
classesFeedtackClasses{}Add CSS classes to Feedtack UI elements
sentimentLabelsFeedtackSentimentLabels—Custom labels for the sentiment buttons
onError(err: Error) => void—Error callback for adapter failures
disabledbooleanfalseSuppress all Feedtack UI (useful for CI/tests); may be toggled after mount — see Gate with a feature flag
renderPinIcon(item: FeedbackItem) => ReactNode—Custom content inside submitted pin markers
onFlush(event: FeedtackFlushEvent) => void—Called when feedback is batched on idle or page unload
flushIdleMsnumber300000Idle timeout in ms before flushing (default 5 min)
rescopeRolesstring[]—User roles that trigger re-scope on reply

FeedtackUser

interface FeedtackUser {
  id: string;        // Unique identifier
  name: string;      // Display name
  role: string;      // e.g. "admin", "designer", "stakeholder"
  avatarUrl?: string; // Shown in threads
  email?: string;     // Reserved for notifications
}

FeedtackTheme

Override Feedtack's appearance with CSS custom properties:

interface FeedtackTheme {
  primary?: string;    // Accent color — active states, focus rings
  background?: string; // Panel background
  surface?: string;    // Input and card surfaces
  text?: string;       // Primary text color
  textMuted?: string;  // Secondary text color
  border?: string;     // Border color
  radius?: string;     // Border radius
  badge?: string;      // Notification badge color
}
<FeedtackProvider
  adapter={adapter}
  currentUser={user}
  theme={{
    primary: "#6366f1",
    background: "#1e1b4b",
    text: "#e0e7ff",
    radius: "12px",
  }}
>

FeedtackClasses

Add CSS classes to specific Feedtack elements:

interface FeedtackClasses {
  button?: string;      // The "Feedback" button
  form?: string;        // The comment form
  thread?: string;      // The thread panel
  colorPicker?: string; // The color picker bar
  pinMarker?: string;   // Individual pin markers
}

DOM isolation

Feedtack renders all UI inside a #feedtack-root div injected at the body level. It does not modify your app's DOM. All CSS classes are namespaced with feedtack- and use !important to avoid Tailwind conflicts.

Example: full production setup

import { FeedtackProvider } from "feedtack/react";
import { WebhookAdapter } from "feedtack";

const adapter = new WebhookAdapter({
  submitUrl: "/api/feedtack",
  loadFeedback: async (filter) => {
    const res = await fetch(`/api/feedtack?pathname=${filter?.pathname ?? ""}`);
    return res.json();
  },
});

export default function App() {
  return (
    <FeedtackProvider
      adapter={adapter}
      currentUser={{ id: "u1", name: "Alice", role: "designer", avatarUrl: "/alice.jpg" }}
      hotkey="p"
      adminOnly
      onError={console.error}
      theme={{ primary: "#6366f1" }}
    >
      <YourApp />
    </FeedtackProvider>
  );
}

On this page