Convert Figma logo to code with AI

surveyjs logosurvey-creator

Embeddable JSON form builder for React, Angular, Vue, and plain JavaScript. Drag-and-drop UI, your backend.

1,274
464
1,274
305

Top Related Projects

Open-source JavaScript form library for React, Angular, Vue, and plain JavaScript. Render dynamic JSON-driven forms, multi-step form wizards, surveys, quizzes, and other data-entry tools.

JavaScript powered Forms with JSON Form Builder

A frontend Framework for single-page applications on top of REST/GraphQL APIs, using TypeScript, React and Material Design

34,331

Build forms in React, without the tears 😭

A jQuery plugin for drag and drop form creation

Quick Overview

SurveyJS Creator is a powerful survey builder and form designer component for web applications. It provides a drag-and-drop interface for creating and customizing surveys, forms, and quizzes, with support for various question types and advanced features like conditional logic and validation.

Pros

  • User-friendly interface with drag-and-drop functionality
  • Extensive customization options for survey appearance and behavior
  • Support for a wide range of question types and advanced features
  • Integration with popular frameworks like React, Vue, and Angular

Cons

  • Steep learning curve for advanced features and customizations
  • Limited built-in themes and styling options
  • Requires a commercial license for some features and production use
  • Documentation can be overwhelming for beginners

Code Examples

  1. Creating a basic survey creator instance:
import { SurveyCreator } from "survey-creator-core";

const creator = new SurveyCreator({
  showLogicTab: true,
  isAutoSave: true
});

creator.render("creatorElement");
  1. Adding a custom question type:
import { QuestionFactory, ElementFactory } from "survey-core";

QuestionFactory.Instance.registerQuestion("myquestion", (name) => {
  return new MyQuestionModel(name);
});

ElementFactory.Instance.registerElement("myquestion", (json) => {
  return new MyQuestionModel(json.name);
});
  1. Saving survey JSON:
creator.saveSurveyFunc = (saveNo, callback) => {
  const json = creator.JSON;
  saveSurveyJson(json).then(() => {
    callback(saveNo, true);
  });
};

Getting Started

To get started with SurveyJS Creator:

  1. Install the package:

    npm install survey-creator-core
    
  2. Import and create a SurveyCreator instance:

    import { SurveyCreator } from "survey-creator-core";
    
    const creator = new SurveyCreator();
    
  3. Render the creator in your HTML:

    creator.render("creatorElement");
    
  4. Access the survey JSON:

    const surveyJson = creator.JSON;
    

For more advanced usage and customization options, refer to the official documentation.

Competitor Comparisons

Open-source JavaScript form library for React, Angular, Vue, and plain JavaScript. Render dynamic JSON-driven forms, multi-step form wizards, surveys, quizzes, and other data-entry tools.

Pros of survey-library

  • More lightweight and focused on survey rendering and data collection
  • Easier to integrate into existing projects without additional UI components
  • Higher flexibility for custom implementations and designs

Cons of survey-library

  • Lacks built-in survey creation and editing capabilities
  • Requires more development effort to create a full survey management system
  • May need additional libraries or custom code for advanced features

Code Comparison

survey-library:

import { Model } from 'survey-core';

const survey = new Model({
  questions: [
    { type: 'text', name: 'name', title: 'Your name:' }
  ]
});

survey-creator:

import { SurveyCreator } from 'survey-creator-core';

const creator = new SurveyCreator({
  showLogicTab: true,
  isAutoSave: true
});

The survey-library code focuses on defining and rendering surveys, while survey-creator provides a full-featured survey editing interface. survey-library offers more granular control over survey structure, whereas survey-creator abstracts much of this complexity behind a user-friendly interface.

JavaScript powered Forms with JSON Form Builder

Pros of formio.js

  • More flexible and customizable form builder with extensive API
  • Supports a wider range of form components and field types
  • Better integration with server-side technologies and databases

Cons of formio.js

  • Steeper learning curve due to its complexity and extensive features
  • Less intuitive drag-and-drop interface compared to survey-creator
  • Requires more setup and configuration for basic use cases

Code Comparison

survey-creator:

const creator = new SurveyCreator();
creator.saveSurveyFunc = (saveNo, callback) => {
    saveSurveyJson(creator.text);
    callback(saveNo, true);
};

formio.js:

Formio.createForm(document.getElementById('formio'), {
  components: [
    { type: 'textfield', key: 'firstName', label: 'First Name' },
    { type: 'textfield', key: 'lastName', label: 'Last Name' },
    { type: 'button', action: 'submit', label: 'Submit' }
  ]
});

The code snippets demonstrate the different approaches to creating forms. survey-creator focuses on a high-level creator object, while formio.js provides more granular control over form components and structure.

A frontend Framework for single-page applications on top of REST/GraphQL APIs, using TypeScript, React and Material Design

Pros of react-admin

  • More comprehensive admin framework with built-in data providers, authentication, and UI components
  • Larger community and ecosystem with extensive documentation and third-party extensions
  • Flexible architecture allowing for custom views and logic beyond just form building

Cons of react-admin

  • Steeper learning curve due to its broader scope and more complex architecture
  • May be overkill for simple survey or form creation tasks
  • Less focused on survey-specific features like question types and logic

Code Comparison

react-admin:

import { Admin, Resource, ListGuesser } from 'react-admin';
import { dataProvider } from './dataProvider';

const App = () => (
  <Admin dataProvider={dataProvider}>
    <Resource name="users" list={ListGuesser} />
  </Admin>
);

survey-creator:

var creator = new SurveyCreator.SurveyCreator("creatorElement");
creator.saveSurveyFunc = function (saveNo, callback) {
  // Save survey here
  callback(saveNo, true);
};

The react-admin example shows how to set up a basic admin interface with a resource, while the survey-creator example demonstrates initializing the survey creator and setting up a save function.

34,331

Build forms in React, without the tears 😭

Pros of Formik

  • Lightweight and focused on form state management
  • Seamless integration with React ecosystem
  • Extensive documentation and community support

Cons of Formik

  • Limited built-in UI components
  • Requires additional libraries for complex form layouts
  • Less suitable for non-React projects

Code Comparison

Formik:

import { Formik, Form, Field } from 'formik';

<Formik initialValues={{ name: '' }} onSubmit={handleSubmit}>
  <Form>
    <Field name="name" />
    <button type="submit">Submit</button>
  </Form>
</Formik>

Survey Creator:

import { SurveyCreator } from "survey-creator";

const creator = new SurveyCreator();
creator.JSON = { elements: [{ type: "text", name: "name" }] };
creator.render("creatorElement");

Key Differences

  • Formik focuses on form state management in React, while Survey Creator is a full-featured survey builder
  • Survey Creator provides a visual editor, whereas Formik requires manual form construction
  • Formik offers more flexibility for custom form layouts, while Survey Creator has pre-built templates and themes

Use Cases

  • Choose Formik for React-based projects requiring custom form implementations
  • Opt for Survey Creator when building complex surveys or questionnaires with a visual editor

A jQuery plugin for drag and drop form creation

Pros of formBuilder

  • Lightweight and easy to integrate
  • Extensive customization options for form fields
  • Active community and regular updates

Cons of formBuilder

  • Limited advanced survey features compared to survey-creator
  • Less comprehensive documentation and examples

Code Comparison

formBuilder:

$(document).ready(function() {
  $('#fb-editor').formBuilder();
});

survey-creator:

var creator = new SurveyCreator.SurveyCreator("creatorElement");
creator.saveSurveyFunc = function(saveNo, callback) {
  // Save survey logic here
};

Key Differences

  • formBuilder focuses on simple form creation, while survey-creator offers more advanced survey functionality
  • survey-creator provides a more comprehensive set of tools for complex surveys and questionnaires
  • formBuilder has a simpler API and is easier to set up for basic use cases
  • survey-creator offers more robust data analysis and reporting features

Use Cases

  • formBuilder: Best for simple contact forms, feedback forms, and basic data collection
  • survey-creator: Ideal for complex surveys, market research, and advanced data gathering scenarios

Community and Support

  • Both projects have active communities and regular updates
  • survey-creator has more extensive documentation and examples available
  • formBuilder has a larger number of GitHub stars and forks, indicating broader adoption

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

banner_form_builder

Build Status Tested with Playwright Issues Closed issues GitHub Release

SurveyJS Survey Creator: Embeddable JavaScript Form Builder

SurveyJS Survey Creator is an embeddable, drag-and-drop form builder for React, Angular, Vue, and plain JavaScript applications. It generates JSON form definitions and connects to your backend and database.

Embed the form builder in your application, connect it to any backend, and let users create dynamic forms, surveys, quizzes, and multi-step form wizards without hard-coding each form. Render completed form definitions with SurveyJS Form Library.


Documentation · Setup Guides for My Stack · Survey Creator Demos · Theme Adapters · Licensing · Report a Bug


Self-Hosted Architecture

SurveyJS Creator is a UI component that you embed in your own web application. It is not a hosted form service and does not require a SurveyJS backend. You choose the server, database, authentication system, and deployment environment.

The visual editor generates a JSON definition for each form. Your application can:

  1. Save the JSON definition to your database.
  2. Load it back into Survey Creator for editing.
  3. Render the form with SurveyJS Form Library.
  4. Store submitted responses in your own backend.

client-server-interaction (3)

This architecture is suitable for applications that require full control over form and response data and integration with existing systems.

Installation

Choose the package for your framework:

React

npm install survey-creator-react

Get Started with Survey Creator for React

Angular

npm install survey-creator-angular

Get Started with Survey Creator for Angular

Vue.js

npm install survey-creator-vue

Get Started with Survey Creator for Vue.js

Plain JavaScript

npm install survey-creator-js

Get Started with Survey Creator for Plain JavaScript

Key Features

Embeddable Form Builder

  • Embed the form builder in React, Angular, Vue, or plain JavaScript applications.
  • Run the editor entirely in the browser.
  • Connect it to any server, database, or authentication system.
  • Store form definitions and submitted data in your own backend.
  • Add the editor to single-tenant or multi-tenant SaaS applications.

Visual Form Editing

  • Build forms with a drag-and-drop UI.
  • Create multi-page forms and form wizards.
  • Configure conditional visibility, branching, validation, and calculated values.
  • Edit form themes through a visual Theme Editor.
  • Preview forms before publication.

JSON-Driven Forms

  • Generate a JSON definition as users edit a form.
  • Load existing JSON definitions back into the editor.
  • Version, copy, and reuse form definitions.
  • Render forms with SurveyJS Form Library.
  • Use the same definition for web forms, PDFs, and analytics workflows.

Customizable UI

  • Use the UI Preset Editor to customize the Toolbox, Property Grid, tabs, actions, languages, and other UI options, then export the configuration as a reusable JSON preset.
  • Add custom question types and reusable components.
  • Apply custom branding and themes, or use theme adapters to map Survey Creator design tokens to Bootstrap, Material UI, or shadcn/ui.
  • Configure the UI for different roles, tenants, or subscription plans.
  • Localize the editor and support right-to-left languages.

Resources

SurveyJS Product Family

  • Form Library - A free and open-source MIT-licensed JavaScript library that renders dynamic JSON-based forms in your web application, and collects responses.
  • Survey Creator - A self-hosted drag-and-drop form builder that automatically generates JSON definition (schemas) of your forms in real time. Try out a free full-featured demo to evaluate its capabilities.
  • Dashboard - Simplifies survey data visualization and analysis with interactive and customizable charts and tables.
  • PDF Generator - A commercially licensed JavaScript library that renders SurveyJS surveys and forms as PDF files in a browser. With PDF Generator you can save an unlimited number of custom-built forms to PDF (both editable and read-only).
  • AI Form Response Extractor - A free and open-source MIT-licensed JavaScript library that extracts responses from paper forms, PDFs, and images, maps them to the SurveyJS schema, and produces a unified response object that can be stored and processed alongside online submissions. (ai-form-response-extractor).

Licensing

SurveyJS Survey Creator requires a commercial license for each software developer who works with the SurveyJS APIs or implements the integration. You can integrate the Survey Creator component to build a proof of concept and evaluate its full functionality without a license. A developer license is only required for production use. SurveyJS Form Library, which renders forms created with Survey Creator, is available under the MIT license.

NPM DownloadsLast 30 Days