---
title: Feedback Form
product: Form Library
description: Discover our customer feedback form template containing a free code example for JavaScript. This form template showcases handy form customization settings configured in SurveyJS Creator: a custom form header, a smart matrix question with rating scales for comprehensive product evaluation, and a convenient datepicker that helps avoid manual data entry.
framework: React
source: https://surveyjs.io/form-library/examples/feedback-form-template-free/reactjs
index: https://surveyjs.io/form-library/examples/overview.md
---

# Feedback Form (React)

<!-- cut -->

A feedback form is used by companies and organizations to collect opinion and comments from customers regarding a particular product, service, or experience. The collected feedback can then be used  to improve service levels or increase the product quality. This demo shows how to create and style a restaurant feedback form using SurveyJS Survey Creator with an integrated Theme Editor.

## Enable Panelless View

Form fields can be framed by panels or displayed without them. This demo uses the panelless view. To enable it in Theme Editor, switch the **General** > **Question appearance** editor to "Without Panels". This editor is mapped to the [`isPanelless`](https://surveyjs.io/form-library/documentation/api-reference/itheme#isPanelless) property in the theme JSON configuration (see the `theme.js` file).

<img src="/Content/Images/examples/featured-demos/panelless-question-appearance.png" alt="Specify panelless question appearance in SurveyJS Theme Editor" width="100%">

## Configure the Form Header

A form header usually consists of a form title, short description, and a logo of your company. It can also display a background image different from the background image of the rest of the form. This section describes how to configure these features.

### Add a Form Title, Description, and Logo

You can specify a form title and description in the Designer tab of Survey Creator. Enter title and description texts in the **Survey title** and **Survey description** editors in the **General** category.

<img src="/Content/Images/examples/featured-demos/survey-title-and-description.png" alt="Specify survey title and description in SurveyJS Survey Creator" width="100%">

To configure a logo, use editors in the **Logo in the Survey Header** category.

<img src="/Content/Images/examples/featured-demos/logo-settings.png" alt="Specify logo in SurveyJS Survey Creator" width="100%">

These editors are mapped to the following survey JSON properties:

- [`title`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#title)
- [`description`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#description)
- [`logo`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logo)
- [`logoWidth`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logoWidth)
- [`logoHeight`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logoHeight)
- [`logoFit`](https://surveyjs.io/form-library/documentation/api-reference/survey-data-model#logoFit)

To position a title and description within a form header, use Theme Editor integrated in Survey Creator. Open the Themes tab, switch to the **Header** category in Property Grid, and use the **Logo alignment**, **Survey title alignment**, and **Survey description alignment** editors to align these elements as required. Ensure that the **View** switch is set to "Advanced".

<img src="/Content/Images/examples/featured-demos/title-description-logo-position.png" alt="Specify the positions of title, description, and logo in SurveyJS Survey Creator" width="100%">

### Add a Background Image to the Form Header

A form header can display a background image that gives your form a more professional look. To add a background image using Theme Editor, open the **Header** category in Property Grid, switch the **View** editor to "Advanced", and use the **Background image** editors.

<img src="/Content/Images/examples/featured-demos/header-background-image.png" alt="Specify a background image for a form header in SurveyJS Survey Creator" width="100%">

The **Background image** editors are mapped to the following properties in the theme JSON schema (see the `theme.js` file):

- [`header`](https://surveyjs.io/form-library/documentation/api-reference/itheme#header).[`backgroundImage`](https://surveyjs.io/form-library/documentation/api-reference/iheader#backgroundImage)
- [`header`](https://surveyjs.io/form-library/documentation/api-reference/itheme#header).[`backgroundImageOpacity`](https://surveyjs.io/form-library/documentation/api-reference/iheader#backgroundImageOpacity)
- [`header`](https://surveyjs.io/form-library/documentation/api-reference/itheme#header).[`backgroundImageFit`](https://surveyjs.io/form-library/documentation/api-reference/iheader#backgroundImageFit)

## Add Rating Scale Controls

A feedback form usually asks a respondent to evaluate or rate a particular characteristic of a product or service on a predefined scale. If your feedback form includes only one or two such characteristic, you can use [standalone Rating Scale survey elements](/form-library/examples/rating-scale/). This demo shows how to organize multiple rating controls in a neat UI using Multi-Select Matrix elements.

To implement this UI, add a panel to your form and add Multi-Select Matrices to that panel. Distribute all characteristics for evaluation between these matrices and add as many rows to each matrix as there are characteristics for it. For instance, in this demo, six characteristics are split between two matrices.

Each matrix should contain only one column of the Rating Scale type. Set the column's `cellType` property to `"rating"` or change the column's **Cell input type** editor to Rating Scale in Survey Creator. A matrix should also have an inverted layout (columns displayed as rows, and vice versa) in order to add a header to each rating control. Enable the [`transposeData`](/form-library/documentation/api-reference/matrix-table-with-dropdown-list#transposeData) property or select the **Layout** > **Transpose rows to columns** editor in Survey Creator. Refer to the `"food-ratings"` and `"venue-ratings"` matrices in the `survey.json` file for code examples.

## Files

### `public/index.html`

```html
<div id="surveyElement" style="position: absolute; top: 0; left: 0; right: 0; bottom: 0; min-height: 100%; height:100%"></div>
```

### `src/SurveyComponent.jsx`

```js
import React from "react";
import { Model } from "survey-core";
import { Survey } from "survey-react-ui";
import "survey-core/survey-core.min.css";
import { themeJson } from "./theme";
import "./index.css";
import { json } from "./json";

function SurveyComponent() {
    const survey = new Model(json);
    survey.applyTheme(themeJson);
    survey.onComplete.add((sender, options) => {
        console.log(JSON.stringify(sender.data, null, 3));
    });
    return (<Survey model={survey} />);
}

export default SurveyComponent;
```

### `src/index.css`

```css
/* You can add your custom CSS here. */
```

### `src/index.js`

```js
import React from "react";
import { createRoot } from "react-dom/client";
import SurveyComponent from "./SurveyComponent";

const root = createRoot(document.getElementById("surveyElement"));
root.render(<SurveyComponent />);
```

### `src/json.js`

```js
export const json = {
  "title": "A Taste of Italy at Home",
  "description": "2972 Westheimer Rd. Santa Ana, Illinois 85486 +1 (209) 555-0104",
  "logo": "https://api.surveyjs.io/private/Surveys/files?name=76db69ce-63ed-416f-a88f-f72fc0da8017",
  "logoWidth": "688",
  "logoHeight": "auto",
  "completedHtml": "<div style=\"max-width:504px;text-align:center;margin: 0px auto 16px auto;\">\n\n<div style=\"background-color:#DD3333;padding:40px 64px 48px 48px;text-align:left;\">\n<h4 style=\"color:#fff;\">Dear {fullname-for-complete-page},</h4>\n<br>\n<p style=\"color:#fff;\">We greatly appreciate your feedback. Your input helps us improve, and we look forward to serving you even better on your next visit.</p>\n<br>\n<p style=\"color:#fff;\">Warm regards,<br> Pizza House</p>\n</div>\n\n</div>\n",
  "pages": [
    {
      "name": "page3",
      "elements": [
        {
          "type": "text",
          "name": "full-name",
          "width": "100%",
          "minWidth": "256px",
          "title": "Full name:"
        },
        {
          "type": "text",
          "name": "contact-information",
          "width": "100%",
          "minWidth": "256px",
          "title": "Email address and/or phone number:"
        },
        {
          "type": "html",
          "name": "html1",
          "html": "<div style=\"height:8px;\"></div>"
        },
        {
          "type": "text",
          "name": "date-of-visit",
          "width": "100%",
          "minWidth": "256px",
          "title": "Date of visit:",
          "inputType": "date"
        },
        {
          "type": "text",
          "name": "number-of-guests",
          "width": "100%",
          "minWidth": "256px",
          "title": "Number of guests in your party:"
        },
        {
          "type": "text",
          "name": "check-amount",
          "width": "100%",
          "minWidth": "256px",
          "title": "Check amount:"
        },
        {
          "type": "html",
          "name": "html2",
          "html": "<div style=\"height:32px;\"></div>"
        },
        {
          "type": "panel",
          "name": "ratings-panel",
          "elements": [
            {
              "type": "matrixdropdown",
              "name": "food-ratings",
              "width": "100%",
              "minWidth": "256px",
              "titleLocation": "hidden",
              "showHeader": false,
              "columns": [
                {
                  "name": "column1",
                  "cellType": "rating",
                  "rateType": "stars"
                }
              ],
              "transposeData": true,
              "choices": [ 1, 2, 3, 4, 5 ],
              "rows": [
                {
                  "value": "food-quality",
                  "text": "Food Quality"
                },
                {
                  "value": "food-taste",
                  "text": "Food Taste"
                },
                {
                  "value": "price",
                  "text": "Price"
                }
              ]
            },
            {
              "type": "matrixdropdown",
              "name": "venue-ratings",
              "width": "100%",
              "minWidth": "auto",
              "titleLocation": "hidden",
              "showHeader": false,
              "columns": [
                {
                  "name": "column1",
                  "cellType": "rating",
                  "rateType": "stars"
                }
              ],
              "transposeData": true,
              "choices": [ 1, 2, 3, 4, 5 ],
              "rows": [
                {
                  "value": "service",
                  "text": "Service"
                },
                {
                  "value": "ambiance",
                  "text": "Ambiance"
                },
                {
                  "value": "cleanliness",
                  "text": "Cleanliness"
                }
              ]
            },
            {
              "type": "comment",
              "name": "suggestions",
              "width": "100%",
              "minWidth": "256px",
              "title": "Your comments or suggestions",
              "titleLocation": "bottom",
              "rows": 1,
              "autoGrow": true,
              "allowResize": false
            }
          ],
          "questionTitleLocation": "top",
          "title": "Please rate the following:",
          "width": "100%",
          "minWidth": "256px"
        },
        {
          "type": "html",
          "name": "question14",
          "html": "<div style=\"height:8px;\"></div>"
        }
      ],
      "title": "Your feedback matters.",
      "description": "Please provide your feedback so that we can continue to improve our service."
    }
  ],
  "calculatedValues": [
    {
      "name": "fullname-for-complete-page",
      "expression": "iif({full-name} notempty, {full-name}, guest)"
    }
  ],
  "questionTitleLocation": "left",
  "questionDescriptionLocation": "underInput",
  "questionErrorLocation": "bottom",
  "completeText": "Submit",
  "widthMode": "static",
  "width": "768"
};
```

### `src/theme.js`

```js
export const themeJson = {
  "themeName": "custom",
  "colorPalette": "light",
  "isPanelless": true,
  "backgroundImage": "",
  "backgroundOpacity": 1,
  "backgroundImageAttachment": "scroll",
  "backgroundImageFit": "cover",
  "cssVariables": {
    "--sjs-questionpanel-hovercolor": "rgba(224, 224, 224, 1)",
    "--sjs-corner-radius": "0px",
    "--sjs-base-unit": "8px",
    "--sjs-font-pagetitle-weight": "600",
    "--sjs-font-pagetitle-size": "32px",
    "--sjs-font-pagetitle-color": "rgba(221, 51, 51, 1)",
    "--sjs-font-pagedescription-color": "rgba(0, 0, 0, 0.5)",
    "--sjs-shadow-small": "inset 0px 0px 0px 1px rgba(0, 0, 0, 0.25)",
    "--sjs2-border-effect-component-panel-default": "0px 0px 0px 1px rgba(0, 0, 0, 0.25)",
    "--sjs-font-questiontitle-weight": "400",
    "--sjs-font-questiontitle-color": "rgba(0, 0, 0, 0.5)",
    "--sjs-font-questiondescription-color": "rgba(0, 0, 0, 0.5)",
    "--sjs-shadow-inner": "0px 1px 0px 0px rgba(0, 0, 0, 0.25)",
    "--sjs-font-editorfont-weight": "600",
    "--sjs-font-editorfont-color": "rgba(221, 51, 51, 1)",
    "--sjs-font-editorfont-placeholdercolor": "rgba(0, 0, 0, 0.5)",
    "--sjs-border-default": "rgba(0, 0, 0, 0.25)",
    "--sjs-border-light": "rgba(0, 0, 0, 0.25)",
    "--sjs-general-backcolor": "rgba(255, 255, 255, 1)",
    "--sjs-general-backcolor-dark": "rgba(248, 248, 248, 1)",
    "--sjs-general-backcolor-dim-light": "rgba(255, 255, 255, 0)",
    "--sjs-general-backcolor-dim-dark": "rgba(243, 243, 243, 1)",
    "--sjs-general-forecolor": "rgba(0, 0, 0, 0.91)",
    "--sjs-general-forecolor-light": "rgba(0, 0, 0, 0.45)",
    "--sjs-shadow-medium": "0px 2px 6px 0px rgba(0, 0, 0, 0.1)",
    "--sjs-shadow-large": "0px 8px 16px 0px rgba(0, 0, 0, 0.1)",
    "--sjs-border-inside": "rgba(0, 0, 0, 0.16)",
    "--sjs-special-red-forecolor": "rgba(255, 255, 255, 1)",
    "--sjs-special-green": "rgba(25, 179, 148, 1)",
    "--sjs-special-green-light": "rgba(25, 179, 148, 0.1)",
    "--sjs-special-green-forecolor": "rgba(255, 255, 255, 1)",
    "--sjs-special-blue": "rgba(67, 127, 217, 1)",
    "--sjs-special-blue-light": "rgba(67, 127, 217, 0.1)",
    "--sjs-special-blue-forecolor": "rgba(255, 255, 255, 1)",
    "--sjs-special-yellow": "rgba(255, 152, 20, 1)",
    "--sjs-special-yellow-light": "rgba(255, 152, 20, 0.1)",
    "--sjs-special-yellow-forecolor": "rgba(255, 255, 255, 1)",
    "--sjs-general-backcolor-dim": "rgba(255, 255, 255, 1)",
    "--sjs-primary-backcolor": "#DD3333",
    "--sjs-primary-backcolor-dark": "rgba(188, 26, 26, 1)",
    "--sjs-primary-backcolor-light": "rgba(221, 51, 51, 0.1)",
    "--sjs-primary-forecolor": "rgba(255, 255, 255, 1)",
    "--sjs-primary-forecolor-light": "rgba(255, 255, 255, 0.25)",
    "--sjs-special-red": "rgba(229, 10, 62, 1)",
    "--sjs-special-red-light": "rgba(229, 10, 62, 0.1)",
    "--sjs-font-surveytitle-size": "24px",
    "--sjs-font-headertitle-size": "24px",
    "--sjs-font-headertitle-color": "rgba(255, 255, 255, 1)",
    "--sjs-font-headerdescription-weight": "600",
    "--sjs-font-headerdescription-size": "16px",
    "--sjs-font-headerdescription-color":  "rgba(255, 255, 255, 1)",
    "--sjs-font-headertitle-weight":  "700"
  },
  "header": {
    "height": 440,
    "inheritWidthFrom": "container",
    "textAreaWidth": 360,
    "backgroundImage": "https://api.surveyjs.io/private/Surveys/files?name=e8421d0e-d2db-4c99-8a62-364b168320f6",
    "backgroundImageOpacity": 0.9,
    "logoPositionX": "center",
    "logoPositionY": "middle",
    "titlePositionX": "center",
    "descriptionPositionX": "center"
  },
  "headerView": "advanced"
};
```

### `package.json`

```json
{
  "dependencies": {
    "react": "latest",
    "react-dom": "latest",
    "survey-core": "latest",
    "survey-react-ui": "latest"
  },
  "devDependencies": {
    "react-scripts": "latest"
  }
}
```

## Other Frameworks

- [Angular](https://surveyjs.io/form-library/examples/feedback-form-template-free/angular.md)
- [Vue 3](https://surveyjs.io/form-library/examples/feedback-form-template-free/vue3js.md)
- [jQuery](https://surveyjs.io/form-library/examples/feedback-form-template-free/jquery.md)
- [Vanilla JS](https://surveyjs.io/form-library/examples/feedback-form-template-free/vanillajs.md)
