React Feedback Form with Ratings

Collect user feedback with star ratings or NPS scores. Beautiful, accessible rating components with optional comment field.

Installation

npm install @formflow.sh/react

Star Rating Form

import { FeedbackForm } from '@formflow.sh/react';

function Feedback() {
  return (
    <FeedbackForm
      apiKey="ff_live_xxx"
      ratingType="stars"
      maxRating={5}
      onSuccess={(data) => {
        console.log('Rating:', data.rating);
      }}
    />
  );
}

NPS Score Form

<FeedbackForm
  apiKey="ff_live_xxx"
  ratingType="nps"
  question="How likely are you to recommend us?"
/>

Props

PropTypeDefaultDescription
apiKeystring-Your FormFlow API key
ratingType"stars" | "nps""stars"Rating style
maxRatingnumber5Max stars (for star rating)
questionstring"How was your experience?"Question text
showCommentbooleantrueShow comment textarea
commentRequiredbooleanfalseRequire comment
theme"minimal" | "modern" | "brutalist" | "glass""minimal"Visual theme

Rating Types

Star Rating (1-5)

Classic 5-star rating. Users click or tap to select their rating. Supports keyboard navigation.

NPS Score (0-10)

Net Promoter Score format. Displays 0-10 scale with Detractor (0-6), Passive (7-8), and Promoter (9-10) labels.

With Required Comment

<FeedbackForm
  apiKey="ff_live_xxx"
  ratingType="stars"
  showComment={true}
  commentRequired={true}
  commentPlaceholder="Tell us more about your experience..."
/>

Features

  • Accessible - Full keyboard and screen reader support
  • Animated - Smooth hover and selection animations
  • Mobile-friendly - Touch-optimized tap targets
  • Analytics - View average ratings in dashboard

Related

React Feedback Form with Star Rating - FormFlow | FormFlow