Try SurveyJS
A robust full-cycle
survey and form solution
for your JavaScript application.
SurveyJS Form Library
import "survey-core/defaultV2.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} />;
}
Survey Creator
import { SurveyCreator, SurveyCreatorComponent } from "survey-creator-react";
import "survey-core/defaultV2.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
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
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 management system examples
You can use SurveyJS components to build a full-cycle survey management system integrated with your backend. Your users will be able to create, modify, and run surveys, collect survey results, and analyze them using visualization tools. View examples of such systems for most popular backend frameworks and CMS:
If you want to learn more about how SurveyJS libraries interact with the server and integrate with your backend, refer to the following help topic: Integrate SurveyJS Libraries with Backend .