Embed library for [React](https://reactjs.org/).
npm install @typeform/embed-reactEmbed library for React.
Requirements:
- node >= 18
- yarn or npm
Install as NPM package using your favourite package manager:
``shell`
yarn add @typeform/embed-react
or
`shell`
npm install --save @typeform/embed-react
Import the component you want to use. Then render it in your React app:
`javascript
import { Widget } from '@typeform/embed-react'
const MyComponent = () => {
return
}
`
Popup and slider components provide a button to open the embed:
`javascript
import { PopupButton } from '@typeform/embed-react'
const MyComponent = () => {
return (
click to open form in popup
)
}
`
You can render popover and slider anywhere in your app (preferably at the end of the page):
`javascript
import { Sidetab } from '@typeform/embed-react'
const MyComponent = () => {
return
}
`
You can find from the public URL of your form:
- https://form.typeform.com/to/
Or from admin panel URL:
- https://admin.typeform.com/form/
Pass options as props to the component.
`javascript`
size={60}
hidden={{
foo: 'Foo Value',
bar: 'Bar Value',
}}
onReady={() => {
console.log('form ready')
}}
enableSandbox
transitiveSearchParams
>
click to open
See all available options in Vanilla JavaScript Embed Library README file. Make sure to pass props in camel case without the data-tf- prefix.
If the global __webpack_nonce__ is set, its value will be used for a nonce attribute on the inline