3.2.3 • Published 5 months ago
@formsort/react-embed v3.2.3
@formsort/react-embed
Embed Formsort flows within react components
Installation
Add @formsort/react-embed to your project by executing npm install @formsort/react-embed
or yarn add @formsort/react-embed
.
Usage
Here's an example of basic usage:
import React from 'react';
import EmbedFlow from '@formsort/react-embed';
const EmbedFlowExample: React.FunctionComponent = () => (
<div>
<EmbedFlow
clientLabel="formsort"
flowLabel="onboarding"
variantLabel="main"
embedConfig={{
style: {
width: '100%',
height: '100%',
},
}}
/>
</div>
);
Events
You can add event listeners to flows like Flowloaded
, redirect
etc. See all event listeners
Props
Prop name | Description | Required | Example values |
---|---|---|---|
clientLabel | client name | yes | formsort |
flowLabel | flow name | yes | onboarding |
variantLabel | variant name | no | main |
responderUuid | responder uuid to load existing answers for | no | e4923baa-dc2d-4555-813c-a166952292fa |
formsortEnv | formsort integrations environment label, if not using production | no | staging |
queryParams | additional query params, to pre-populate answers in the form | no | [['name', 'Olivia']], ['age', '3']] |
embedConfig | config passed to the underlying FormsortWebEmbed | no | { style: { height: '100%' } } |
onFlowLoaded | event listener | no | () => { console.log('flow loaded') } |
onFlowClosed | event listener | no | () => { console.log('flow closed') } |
onFlowFinalized | event listener | no | () => { console.log('flow finalized') } |
onStepLoaded | event listener | no | () => { console.log('step loaded') } |
onStepCompleted | event listener | no | () => { console.log('step loaded') } |
onRedirect | event listener | no | (url: string) => { console.log('redirecting to:', url) } |
Testing
npm run test
Publishing
npm publish
3.2.2
8 months ago
3.2.3
5 months ago
3.1.2
1 year ago
3.1.1
1 year ago
3.1.0
2 years ago
2.1.2
2 years ago
2.1.1
2 years ago
2.1.3
2 years ago
3.0.0
2 years ago
2.0.4
2 years ago
2.1.0
2 years ago
2.0.3
3 years ago
2.0.2
3 years ago
2.0.1
3 years ago
2.0.0
3 years ago
1.3.0
3 years ago
1.2.2
3 years ago
1.2.1
3 years ago
1.1.9
3 years ago
1.1.11
3 years ago
1.1.10
3 years ago
1.1.8
3 years ago
1.1.7
4 years ago
1.1.6
4 years ago
1.1.5
4 years ago
1.1.4
4 years ago
1.1.3
4 years ago
1.2.0
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.0
4 years ago
0.0.1
4 years ago