Renders each component at a time with a next button, and when all components are traversed then all components are shown at once for review with a submit button.
npm install react-typeform --save
<div>
...Your individual component here
</div>
The individual components to be shown one by one
Function that executes when submit button is clicked
Text to be displayed for submit button Default: Submit
Classname for submit button
Text to be displayed for next button Default: Next
Classname for next button
Function that executes when next button is clicked
Text to be displayed for back button Default: Back
Classname for back button
Function that executes when back button is clicked
Boolean that sets whether to show a review view as the final step Default: true
import React from 'react';
import TypeForm from 'react-typeform';
class TypeFormComponent extends React.Component {
submit() {
// Call your submit function here
}
render() {
return(
{/** You can wrap this into your favourite form
* But use the onSubmit function to call function that executes on click
*/}
<TypeForm
onSubmit={this.submit}
>
<Component1 />
<Component2 />
...
</TypeForm>
);
}
}
export default TypeFormComponent;
MIT