Skip to content

Latest commit

 

History

History
83 lines (72 loc) · 2.53 KB

README.md

File metadata and controls

83 lines (72 loc) · 2.53 KB

🔌 survey-standalone

SurveyJS is a modern way to add surveys and forms to your website. It has versions for angular2+, jQuery, knockout, react and vue frameworks. This is standalone implementation of SurveyJS library. It can be used with any framework or without any one.

advantages

  • framework agnostic

limitations

This is my "side" hobby project and it doesn't contain all SurveyJS questions and features. If you want to request some functionality from the SurveyJS library feel free to create an issue here.

examples

installation (npm):

npm install survey-standalone

installation (es5 style / script):

<link rel="stylesheet" href="https://unpkg.com/survey-standalone/dist/survey-standalone.css" />
<script src="https://unpkg.com/survey-standalone/dist/survey-standalone.min.js"></script>

usage

<div id="surveyElement"></div>
Survey.StylesManager.applyTheme('modern');

const json = {
  title: 'Survey standalone example !',
  pages: [
    {
      questions: [
        {
          type: 'radiogroup',
          name: 'car',
          title: 'What car are you driving?',
          isRequired: true,
          hasOther: true,
          colCount: 4,
          choices: [
            'None',
            'Ford',
            'Vauxhall',
            'Volkswagen',
            'Nissan',
            'Audi',
            'Mercedes-Benz',
            'BMW',
            'Peugeot',
            'Toyota',
            'Citroen',
          ],
        },
      ],
    }
  ],
};

const targetNode = document.querySelector('#surveyElement');
window.survey = new Survey(json);
survey.showProgressBar = 'top';
survey.render(targetNode);

api docs

check the SurveyJS documentation

build

  • git clone https://github.com/dmitrykurmanov/survey-standalone.git
  • npm install
  • npm run dev

thanks to

SurveyJS
Svelte
Rollup
YogliB