react-jsonschema-survey
v1.0.1
Published
Use react-jsonschema to build survey components.
Downloads
16
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.
Install
npm install --save react-jsonschema-survey
Usage
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