https://github.com/formspree/formspree-js
The fastest way to hook up a React form
https://github.com/formspree/formspree-js
formspree jamstack react serverless
Last synced: 10 days ago
JSON representation
The fastest way to hook up a React form
- Host: GitHub
- URL: https://github.com/formspree/formspree-js
- Owner: formspree
- License: mit
- Created: 2020-07-09T20:59:36.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2026-03-16T20:32:56.000Z (11 days ago)
- Last Synced: 2026-03-17T07:24:19.437Z (10 days ago)
- Topics: formspree, jamstack, react, serverless
- Language: TypeScript
- Homepage: https://formspree.io/javascript
- Size: 1.37 MB
- Stars: 75
- Watchers: 8
- Forks: 16
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Formspree JS
A monorepo containing libraries for seamless form integration with [Formspree](https://formspree.io/) via JavaScript and/or React.
## Packages
### `@formspree/core`
Core submission client and types. Provides `createClient`, `getDefaultClient`, `SubmissionError`, and submission types.
```sh
npm install @formspree/core
yarn add @formspree/core
pnpm add @formspree/core
```
### `@formspree/react`
React hooks (`useForm`, `useSubmit`) and components (`ValidationError`) built on top of core.
**Prerequisites:** React 16.8 or higher.
```sh
npm install @formspree/react
yarn add @formspree/react
pnpm add @formspree/react
```
_Note: `@formspree/core` is a dependency of `@formspree/react`, so you don't need to install it separately._
### `@formspree/ajax`
Vanilla JavaScript library for declarative form handling with plain HTML forms. No framework required — use data attributes and a single `initForm()` call, or load via a script tag with the `window.formspree()` global API.
```sh
npm install @formspree/ajax
yarn add @formspree/ajax
```
_Note: `@formspree/core` is a dependency of `@formspree/ajax`, so you don't need to install it separately._
Or via CDN (no bundler needed):
```html
window.formspree =
window.formspree ||
function () {
(formspree.q = formspree.q || []).push(arguments);
};
formspree('initForm', { formElement: '#my-form', formId: 'YOUR_FORM_ID' });
```
See the [@formspree/ajax README](./packages/formspree-ajax/README.md) for full documentation.
## Help and Support
For help and support please see [the Formspree React docs](https://help.formspree.io/hc/en-us/articles/360055613373).
## Contributing
Please follow our [contributing guidelines](./CONTRIBUTING.md).