Licence
MIT
Version
1.0.1
Deps
9
Size
4.5 MB
Vulns
0
Weekly
0
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