Survey Components

CSAT5 (Customer Satisfaction Score, 5-Point Scale)

Surveys to ask users about their overall satisfaction.

Example questions:

  • "How satisfied are you with our product?"
  • "How would you rate your overall experience?"
  • "How satisfied are you with our customer support?"
CSAT5
import { CSAT5Survey } from 'react-feedback-surveys';
import 'react-feedback-surveys/index.css';

<CSAT5Survey
  scaleStyle="emoji"
  question="How would you rate your satisfaction with our product?"
  minLabel="Very unsatisfied"
  maxLabel="Very satisfied"
  responseType="text"
  textQuestion="We'd love to hear your thoughts — what can we improve?"
  textButtonLabel="Send"
  thankYouMessage="Thanks for your feedback!"
  onScoreSubmit={({ value }) => {/* ... */}}
  onFeedbackSubmit={({ value, comment }) => {/* ... */}}
/>

scaleStyle: emoji | numbers | stars.

CSAT2 (Customer Satisfaction Score, 2-Point Scale)

Surveys to ask users about specific features or flows.

Example questions:

  • "Was this search helpful?"
  • "Did you find what you were looking for?"
  • "Are you satisfied with the checkout process?"
CSAT2
import { CSAT2Survey } from 'react-feedback-surveys';
import 'react-feedback-surveys/index.css';

<CSAT2Survey
  scaleStyle="thumbs"
  question="Are you satisfied with the result?"
  responseType="text"
  textQuestion="We'd love to hear your thoughts — what can we improve?"
  textButtonLabel="Send"
  thankYouMessage="Thank you for your feedback!"
  onScoreSubmit={({ value }) => {/* ... */}}
  onFeedbackSubmit={({ value, comment }) => {/* ... */}}
/>

scaleStyle: emoji | thumbs.

NPS10 (Net Promoter Score, 0–10 Scale)

Surveys to ask users if they'd recommend your product.

Example questions:

  • "How likely are you to recommend us to a friend or colleague?"
  • "On a scale of 0-10, would you recommend our service?"
  • "How likely are you to recommend this product to others?"
NPS10 NPS10 mobile
import { NPS10Survey } from 'react-feedback-surveys';
import 'react-feedback-surveys/index.css';

<NPS10Survey
  scaleStyle="numbers"
  question="How likely are you to recommend our product/service to a friend or colleague?"
  minLabel="Very unlikely"
  maxLabel="Very likely"
  responseType="text"
  textQuestion="We'd love to hear your thoughts — what can we improve?"
  textButtonLabel="Send"
  thankYouMessage="Thank you for your feedback!"
  onScoreSubmit={({ value }) => {/* ... */}}
  onFeedbackSubmit={({ value, comment }) => {/* ... */}}
/>

scaleStyle: numbers.

CES7 (Customer Effort Score, 7-Point Scale)

Surveys to ask users how easy it is to use your product.

Example questions:

  • "How easy was it to complete your task?"
  • "How much effort did it take to resolve your issue?"
  • "How easy was it to sign up for an account?"
CES7
import { CES7Survey } from 'react-feedback-surveys';
import 'react-feedback-surveys/index.css';

<CES7Survey
  scaleStyle="numbers"
  question="How easy was it to complete your task?"
  minLabel="Very difficult"
  maxLabel="Very easy"
  responseType="text"
  textQuestion="We'd love to hear your thoughts — what can we improve?"
  textButtonLabel="Send"
  thankYouMessage="Thank you for your feedback!"
  onScoreSubmit={({ value }) => {/* ... */}}
  onFeedbackSubmit={({ value, comment }) => {/* ... */}}
/>

scaleStyle: numbers.

Layout Components

The <Popup> component wraps survey widgets in a fixed overlay that slides in from the screen edge. It includes positioning, animations, and a close button for easy dismissal.

CSAT5 Popup

Usage

import { Popup, CSAT5Survey } from 'react-feedback-surveys';
import 'react-feedback-surveys/index.css';

<Popup
  animated
  classNames={{
    base: 'custom-popup-base',
    content: 'custom-popup-content',
    close: 'custom-popup-close'
  }}
  placement="bottomRight"
  onClose={() => console.log('Closed')}
>
  <CSAT5Survey
    scaleStyle="stars"
    question="How would you rate your satisfaction?"
    onScoreSubmit={({ value }) => {/* ... */}}
  />
</Popup>

Props

Comparison table
PropTypeRequiredDefaultDescription
placement'topLeft' | 'topRight' | 'bottomRight' | 'bottomLeft'-'bottomRight'Position of the popup relative to the screen edges.
animatedboolean-trueEnables a fade-in animation when the popup appears.
classNamestring--Additional CSS class name for the popup container.
classNames{ base?: string; content?: string; close?: string }--Optional class names for internal popup elements.
childrenReact.ReactNode--Content to render inside the popup (typically a survey component).
onClose() => void--Callback fired when the close button is clicked.

For more examples, check out the Storybook stories (e.g., CSAT5Survey.stories.tsx, CSAT2Survey.stories.tsx).

Surface

The <Surface> component is a basic container wrapper that provides consistent styling for survey content. It's used internally by the Popup component and can be used standalone to display surveys with a card-like appearance.

The Surface component provides:

  • Background color with depth/elevation (box shadow)
  • Rounded corners (8px border radius)
  • Responsive padding that adapts to mobile devices

Usage

import { Surface, CSAT5Survey } from 'react-feedback-surveys';
import 'react-feedback-surveys/index.css';

<Surface className="custom-surface">
  <CSAT5Survey
    scaleStyle="stars"
    question="How would you rate your satisfaction?"
    onScoreSubmit={({ value }) => {/* ... */}}
  />
</Surface>

Props

Comparison table
PropTypeRequiredDefaultDescription
classNamestring--Additional CSS class name for the surface container.
childrenReact.ReactNode--Content to render inside the surface.

The Surface component uses the --ft-surface-padding and --ft-surface-padding-mobile CSS variables for responsive padding.

Props

Most props are shared across all survey widgets. Each widget differs only in its scaleStyle values.

Shared Props

Comparison table
PropTypeRequiredDescription
classNames{ base?: { base?: string; head?: string; title?: string; body?: string; close?: string }; scale?: { base?: string; list?: string; button?: string; icon?: string; score?: string; labels?: string } }-Optional class names to target internal parts.
questionstringrequiredMain survey question displayed on the first screen.
minLabelstring-Left label for the scale.
maxLabelstring-Right label for the scale.
responseTypenull | 'text' | 'choices'-Enables optional follow-up feedback.
textQuestionstring-Follow-up question displayed when responseType is defined.
textButtonLabelstring-Submit label for the feedback screen.
choiceOptionsstring[] | null-Predefined choices (when responseType === 'choices').
thankYouMessagestringrequiredMessage shown after submission.

Shared Events

Comparison table
PropTypeRequiredDescription
onScoreSubmit({ value: number }) => void | Promise<void>-Fires immediately when a score is selected, before any follow-up feedback screen. Captures the raw rating.
onFeedbackSubmit({ value: number; comment?: string | string[] }) => void | Promise<void>-Fires when feedback is submitted. Includes the selected score and the user’s comment(s).

Event behavior

onScoreSubmit

Invoked immediately when the user selects a score on the rating scale — this callback runs before any optional follow-up screen is shown. Use it to persist the rating instantly. The actual value returned depends on the survey type:

  • CSAT2: 0–1
  • CSAT5: 1–5
  • CES7: 1–7
  • NPS10: 0–10

onFeedbackSubmit

Invoked when the user completes the follow-up step and submits their feedback (only applies when responseType is text or choices). This callback provides both the original score and the user's input.

Arguments:

  • value: number — the same score previously passed to onScoreSubmit
  • comment: string | string[] — depends on responseType:
    • text: a single text comment
    • choices: an array of selected options (may include a free-text comment if enabled)

Important You should listen to both onScoreSubmit and onFeedbackSubmit. A user may select a score but abandon the follow-up screen (close the widget, navigate away, refresh, etc.). Handling both events ensures you capture at least the rating even when additional feedback is not provided — and still receive extended data when it is.

Scale Style Options

Each survey type supports specific scale styles for displaying the rating interface:

CSAT2Survey

Comparison table
PropTypeRequiredDescription
scaleStyle'emoji' | 'thumbs'requiredEmoji mood scale style (happy/sad faces) or thumbs up/down emoji scale style.

CSAT5Survey

Comparison table
PropTypeRequiredDescription
scaleStyle'emoji' | 'numbers' | 'stars'requiredEmoji scale style (5 emotion levels), numeric scale style (1–5), or star rating scale style (1–5 stars).

CES7Survey

Comparison table
PropTypeRequiredDescription
scaleStyle'numbers'requiredNumeric scale style (1–7).

NPS10Survey

Comparison table
PropTypeRequiredDescription
scaleStyle'numbers'requiredNumeric scale style (0–10).

Note: The numeric ranges are defined by the widget (e.g., CSAT5 uses a 1–5 scale, NPS10 uses 0–10).

Demo

Credits

Emoji icons used in this package are from Sensa Emoji — thanks to the Sensa team for creating such a great set of expressive icons.


See Also

  • Styling Guide - Customize survey appearance with CSS variables and custom classes
  • Contributing - Build and develop survey components locally
  • Changelog - Track new features and component updates