Simple [React](http://facebook.github.io/react/) component acting as a thin layer over the [CustomGForm - Google Form Customizer](https://customgform.com/)
npm install @customgform-lib/react-customgformSimple React component acting as a thin layer over the CustomGForm - Google Form Customizer
``bash`
npm install @customgform-lib/react-customgform
`bash`
yarn add @customgform-lib/react-customgform
`bash`
pnpm add @customgform-lib/react-customgform
`tsx`
/>
Common props you may want to specify include:
- formId - unique form id, taken from https://customgform.com/prefillFields
- - e.g { '1801257527': 'user@gmail.com' } list of fields to prefill, separated by semicolonhiddenFields
- - e.g ['1801257527', '1801257527'] list of fields to hidemode
- - standard | popup, form display modelabel
- - Popup button text. If empty: button will be hiddeninlineStyles
- - Popup button inline stylesbuttonClassName
- - Popup button own class name
tsx
// ts
import React from 'react';
import CustomGForm from '@customgform-lib/react-customgform';function Example() {
{/ standard mode /}
return formId="clj5flan90005wnju2yq4k38b"
prefillFields={{
'325391704': 'John',
'1801257527': 'user@gmail.com',
}}
hiddenFields={['325391704']}
/>;
}
`$3
`tsx
// ts
import React from 'react';
import CustomGForm from '@customgform-lib/react-customgform';function Example() {
return <>
{/ define own styles if needed /}
formId="clj5flan90005wnju2yq4k38b"
mode='popup'
label="Show form"
inlineStyles=''
buttonClassName='btn'
prefillFields={{
'325391704': 'John',
'1801257527': 'user@gmail.com',
}}
inlineStyles='border: none;'
/>
>;
}
`Global callbacks methods to show, hide, toggle modal dialog with form:
`javascript
var formId = 'clj5flan90005wnju2yq4k38b'; // replace FORM_ID to your form id
// toggle modal: if shown, it'll be hidden, if hidden, it would be shown
window.CustomGForm.toggleModal(formId);
// show modal
window.CustomGForm.showModal(formId);
// close modal
window.CustomGForm.closeModal(formId);
``MIT