├── .gitattributes ├── .gitignore ├── README.md ├── dist ├── index.d.ts ├── index.js ├── lib │ ├── handler.d.ts │ └── types.d.ts ├── react.cjs.development.js ├── react.cjs.development.js.map ├── react.cjs.production.min.js ├── react.cjs.production.min.js.map ├── react.esm.js └── react.esm.js.map ├── package.json ├── src ├── index.ts └── lib │ ├── handler.ts │ └── types.ts ├── tsconfig.json ├── tslint.json └── yarn.lock /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Formcarry React 2 | 3 | React library of [formcarry](https://formcarry.com). 4 | 5 | ## Getting Started 6 | 7 | Run this command to install with yarn: 8 | 9 | ``` 10 | yarn add @formcarry/react 11 | ``` 12 | 13 | or with npm: 14 | 15 | ``` 16 | npm install --save @formcarry/react 17 | ``` 18 | 19 | 20 | *You have to have React as a dependency in your project in order to use this library.* 21 | 22 | Also this package uses [React Hooks](https://reactjs.org/docs/hooks-intro.html), therefore you have to use React >= 16.8.0 23 | 24 | ### Example 25 | 26 | A simple demonstration with React library: 27 | 28 | ```jsx 29 | import { useForm } from '@formcarry/react'; 30 | 31 | function MyFormcarry() { 32 | // Call the `useForm` hook in your function component 33 | const {state, submit} = useForm({ 34 | id: 'Your-Form-ID-From-Formcarry' 35 | }); 36 | 37 | // Success message 38 | if (state.submitted) { 39 | return
Thank you! We received your submission.
; 40 | } 41 | 42 | return ( 43 |
44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 |