Installation
React.js
Integrate Surface Forms with React.js to embed forms in your React.js application.
1. Embed the Surface Form
-
Using an iFrame directly:
-
Using script (Recommended)
- Go to the
public/index.html
file in your React.js project and add the following code at the end of<body>
tag:
- Replace
your_form_url
with the form sharing link you copied in step 1. - Replace
surface_embed_type
with"popup"
if you want to show the form as a popup or"inline"
if you want to show the form inline. - Replace
target_element_class
with"surface-form-button"
if you want to show the form as a popup or"surface-form-target"
if you want to show the form inline. - Replace
popupSize
with"small"
,"medium"
, or"large"
if you want to set the size of the popup form.
- Go to the
2. Add className to the target element
Add surface-form-button
class to the HTML element if you want to show the form as a popup or surface-form-target
class to the target element if you want to show the form inline.
3. All done!
You have successfully integrated Surface Forms with your React.js application. You can now embed forms in your React.js application.