react-jsonschema-survey

Use react-jsonschema to build survey components.

Usage no npm install needed!

<script type="module">
  import reactJsonschemaSurvey from 'https://cdn.skypack.dev/react-jsonschema-survey';
</script>

README

react-jsonschema-survey

Use react-jsonschema-form to build survey components. Consists of modes for builder/preview and live. JSON Schema can be built and copied.

NPM JavaScript Style Guide

Install

npm install --save react-jsonschema-survey

Usage

Demo

Demo Example Code Here

import React, { Component } from 'react'
import SurveySchemaGenerator from 'react-jsonschema-survey'
import { DATA, MODE } from './custom'

class Example extends Component {
  onFinishSurvey = (result) => {
    console.log('onFinishSurvey results:', result);
  }
  render () {
    return (
      <SurveySchemaGenerator data={DATA} mode={MODE} onFinishSurvey={this.onFinishSurvey} />
    )
  }
}

Component API

<SurveySchemaGenerator> component:

Property Type Default Required Description
data Array n/a yes Array of question schemas
mode String n/a yes Builder or Live
onFinishSurvey Function n/a yes Return live survey answers

Uses npm packages react-quick-alert and react-simple-promise-modal

License

MIT © calabashlabsllc

Reference

react-jsonschema-form documentation