NPS Survey
Collect structured and freeform feedback from your users
Related resources
-
Launch surveys with no-code using Collections
-
Target your survey to specific users with Targeting
-
See industry examples of surveys
Demo
- Interact with surveys in our live demo
Code
Alternative scales
The component comes with a default NPS scale of 0-10. You can also use a custom scale by passing the options
property either directly in the React component or in the YAML config via the props
property. For instance, in the example below, we’re using an emoji scale:
Flow Configuration
The following props are available in the YAML Config defined in the Frigade Dashboard:
Possible values:
false
, flow.back
, flow.complete
, flow.forward
, flow.restart
, flow.skip
, flow.start
, step.complete
, step.skip
, step.reset
, step.start
primaryButton.title
instead. The title of the primary buttonprimaryButton.uri
instead. The url to open when the primary button is clickedprimaryButton.target
instead. The target of the primary button url (default: _blank; use _self to open in the same window). Setting it to # will open the existing page and dismiss any Frigade modals.Possible values:
false
, flow.back
, flow.complete
, flow.forward
, flow.restart
, flow.skip
, flow.start
, step.complete
, step.skip
, step.reset
, step.start
secondaryButton.title
instead. The title of the secondary buttonsecondaryButton.uri
instead. The url to open when the secondary button is clickedsecondaryButton.target
instead. The target of the secondary button url (default: _blank; use _self to open in the same window). Setting it to # will open the existing page and dismiss any Frigade modals.select
type field.text
, textarea
, select
, checkbox
, and radio
. If you are using custom form field types, the name here should match it.React Component Props
as
Optional
as: ElementType
<any
, keyof IntrinsicElements
>
Optional component to wrap the child components in, e.g. as={Dialog}
will render the Flow in a modal Dialog. Defaults to Box
.
css
Optional
css: Interpolation
<Theme
>
Emotion CSS prop to apply to the component. See Theming documentation for more information.
Example usage:
dismissible
Optional
dismissible: boolean
Whether the Flow is dismissible or not
fieldTypes
Optional
fieldTypes: FieldTypes
Custom field types to be used in the Form.
You can use this to build your own custom form fields in a Form
.
For example, if you want to use a custom field type called calendar
:
flowId
flowId: string
The Flow ID to render. You can find the Flow ID in the Frigade dashboard.
forceMount
Optional
forceMount: boolean
If true, the Flow will be mounted even if it has already been completed or dismissed. However, if the user does not match the Flow’s targeting, the Flow will not be mounted.
modal
Optional
modal: boolean
Register the Flow as a modal to prevent popup collisions (only one modal Flow will render at a time).
negativeLabel
Optional
negativeLabel: string
The label to display for the negative end of the NPS scale. If not provided, the default label “Not likely at all” will be used.
onComplete
Optional
onComplete: FlowHandlerProp
Handler for when the Flow is completed. This is event is fired immediately after the user completes the Flow.
onDismiss
Optional
onDismiss: FlowHandlerProp
Handler for when the Flow is dismissed (skipped). This is event is fired immediately after the user dismisses the Flow.
onPrimary
Optional
onPrimary: StepHandlerProp
Handler for when primary button is clicked.
If this function returns false or a promise that resolves to false
, the step will not be automatically completed when clicked.
onSecondary
Optional
onSecondary: StepHandlerProp
Handler for when secondary button is clicked.
If this function returns false or a promise that resolves to false
, the step will not be automatically completed when clicked.
options
Optional
options: NPSOptions
The options to display in the NPS field. If not provided, the default NPS numbers from 0 to 10 will be used.
positiveLabel
Optional
positiveLabel: string
The label to display for the positive end of the NPS scale. If not provided, the default label “Extremely likely” will be used.
variables
Optional
variables: Record
<string
, unknown
>
Variables to pass to the Flow. You can use variables in the Flow configuration to customize copy.
For instance, you can use title: Hello, ${name}!
in the Flow configuration and pass variables={{name: 'John'}}
to customize the copy.