Build JSON Forms and Surveys
in React

SurveyJS for React is a set of client-side JavaScript libraries for building a custom form and survey management system inside your React application.

SurveyJS Form Library

Use Form Library to render dynamic forms and surveys from JSON schemas in your React application. It supports multi-page forms, conditional logic, validation, calculated values, file upload, matrices, dynamic panels, progress bars, and custom question types.
  • Multi-step forms / form wizard
  • Conditional logic
  • Dynamic panels / repeatable sections
  • Auto-populated fields
  • Custom validation
  • Calculated values
  • Save and restore incomplete forms
import "survey-core/survey-core.min.css";
import { Model } from "survey-core";
import { Survey } from "survey-react-ui";

const surveyJson = {
  // ...
};

export function SurveyComponent() {
    const survey = new Model(surveyJson);
    survey.onComplete.add((sender, options) => {
        // Store data in your data storage
        console.log(
            JSON.stringify(sender.data, null, 3));
    });
    return <Survey model={survey} />;
}

SurveyJS Survey Creator

Survey Creator is a drag-and-drop form builder for React applications. Embed it in your app to let users create and edit forms visually, while your application stores and manages the generated JSON schema.
  • White-label UI
  • Customizable Toolbox & Settings Panel
  • UI Preset Editor
  • Theme Editor
  • Custom question types
  • Multi-user form editing
  • Localization / translations
import { SurveyCreator, SurveyCreatorComponent } from "survey-creator-react";
import "survey-core/survey-core.min.css";
import "survey-creator-core/survey-creator-core.min.css";

const creatorOptions = {
  // ...
};

export function SurveyCreatorWidget() {
  const creator = new SurveyCreator(creatorOptions);
  return <SurveyCreatorComponent creator={creator} />;
}

SurveyJS Dashboard

Use Dashboard to visualize survey results with charts, tables, and custom visualizers.
  • Survey results analysis
  • Live response updates
  • Response filtering and sorting
  • Custom visualizers
  • Export responses
  • Pivot chart
  • Table view
const surveyJson = {
  // ...
};

const survey = new Survey.Model(json);
const allQuestions = survey.getAllQuestions();
const node = document.getElementById("survey-dashboard");

fetch("https://www.example.com/survey-results/")
  .then(response => response.json())
  .then(data => {
    const vizPanel = new SurveyAnalytics.VisualizationPanel(
      allQuestions,
      data
    );
    vizPanel.render(node);
});

SurveyJS PDF Generator

Use PDF Generator to create printable, editable, or read-only PDF forms from the same SurveyJS JSON schema.
  • Export web forms to PDF
  • Generate completed response records
  • Fill existing PDF forms
  • Create read-only PDF documents
  • Apply custom fonts
  • Configure PDF page size, orientation, and margins
  • Customize PDF themes and layouts
import { SurveyPDF } from "survey-pdf";

function prepareSurveyPDF() {
  const surveyPDF = new SurveyPDF(json);
  surveyPDF.data = survey.data;
  return surveyPDF;
}
function savePdfAsFile() {
  const surveyPDF = prepareSurveyPDF();
  surveyPDF.save("surveyAsFile.pdf");
}
function savePdfAsBlob() {
  const surveyPDF = prepareSurveyPDF();
  surveyPDF
    .raw("bloburl")
    .then(function (bloburl) {
      const a = document.createElement("a");
      a.href = bloburl;
      a.download = "surveyAsBlob.pdf";
      document.body.appendChild(a);
      a.click();
    });
}
function previewPdf() {
  const surveyPDF = prepareSurveyPDF();
  const oldFrame = document.getElementById("pdf-preview-frame");
  if (oldFrame)
    oldFrame.parentNode.removeChild(oldFrame);
  surveyPDF
    .raw("dataurlstring")
    .then(function (dataurl) {
      const pdfEmbed = document.createElement("embed");
      pdfEmbed.setAttribute("id", "pdf-preview-frame");
      pdfEmbed.setAttribute("type", "application/pdf");
      pdfEmbed.setAttribute("style", "width:100%");
      pdfEmbed.setAttribute("height", 200);
      pdfEmbed.setAttribute("src", dataurl);
      const previewDiv = document.getElementById("pdf-preview");
      previewDiv.appendChild(pdfEmbed);
  });
}
Survey Creator creates the JSON schema. Form Library renders that schema as an interactive form. Submitted responses are saved to your database. Dashboard reads the schema and responses to display results. PDF Generator uses the same schema and response data to create PDF forms.

Survey Management System Examples

SurveyJS UI libraries let you build a full-cycle survey management system inside your React application. Users can design forms, publish surveys, submit and review responses, and export completed data to PDF without leaving your app. The same architecture is available for Angular, Vue.js, jQuery, and Vanilla JavaScript.

View examples of such systems for the most popular backend frameworks and CMS.

Node.js

Learn how to integrate SurveyJS components with a Node.js server.

ASP.NET Core

View a demo example of how SurveyJS works with an ASP.NET Core backend.

PHP

Configure client-server interaction of SurveyJS components with a PHP backend.

WordPress

Embed SurveyJS Form Library and Survey Creator in your site using a WordPress plugin.

Domain Model

Generate forms for domain models and edit them in Survey Creator.

Node.js + PostgreSQL

Save forms and user responses in a PostgreSQL database on a Node.js server.

Node.js + MongoDB

Integrate SurveyJS components with a Node.js server that uses a MongoDB database.

Python

Configure client-server interaction of SurveyJS components with a Python backend.

To learn more about how SurveyJS libraries interact with your backend, see the following help topic: Integrate SurveyJS Libraries with Backend

Frequently Asked Questions

Can I build JSON schema forms in React with SurveyJS?

Yes. SurveyJS lets you build and render JSON schema forms in React. The form structure, question types, validation rules, conditional logic, calculated values, and navigation are defined in JSON. This allows teams to manage form changes through JSON schema updates or Survey Creator, rather than hardcoding each change into React components.

Can I embed Survey Creator into a React app?

Yes. Survey Creator can be embedded into a React application as a visual form builder. It gives users a drag-and-drop interface for creating and editing forms without writing code. Behind the scenes, Survey Creator generates a JSON schema that your application can save, manage, and render with SurveyJS Form Library.

Does SurveyJS store form data?

No. SurveyJS does not store your form schemas, responses, uploaded files, or user data. SurveyJS libraries run in your application, and your team decides where data is stored. You can keep survey definitions and response data in your own database, private cloud, or internal infrastructure.

Can I use SurveyJS with my own database?

Yes. SurveyJS libraries run on the client side. They are backend-agnostic and can work with any database or server-side technology. Your application can save form JSON schemas, collect responses, manage users, control access, and connect survey data to any internal system.

Is SurveyJS Form Library open source?

Yes. SurveyJS Form Library is an MIT-licensed open-source JavaScript form library. It can be used to render JSON-driven forms and surveys in React, Angular, Vue, jQuery, and plain JavaScript applications. Other SurveyJS products, such as Survey Creator, Dashboard, and PDF Generator, are commercial libraries with source code available on GitHub.

Can I export SurveyJS forms to PDF?

Yes. SurveyJS PDF Generator lets you create PDF documents from SurveyJS form schemas and response data. You can generate printable forms, completed response records, editable PDF forms, or read-only PDF files. This allows you to use the same JSON form definition for both the web form and the PDF version.

Can I use SurveyJS with Next.js?

Yes. SurveyJS can be used in Next.js applications with the React packages.

Still Got Questions?

Check our FAQ or Contact Us

Your cookie settings

We use cookies to make your browsing experience more convenient and personal. Some cookies are essential, while others help us analyse traffic. Your personal data and cookies may be used for ad personalization. By clicking “Accept All”, you consent to the use of all cookies as described in our Terms of Use and Privacy Statement. You can manage your preferences in “Cookie settings.”

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.