# React Integration: Email Validation

URL: https://email-validation.org/integrations/react/
Updated: 2026-11-29

> Documentation index: https://email-validation.org/llms.txt

A FormGuard component wraps the forms of your React app and checks each email field once the visitor has finished with it, with a one-click fix for typos. It stops the form only for the results you choose, invalid and disposable by default, and every submission goes through when something goes wrong.

[Read the full setup guide](https://email-validation.org/docs/form-guard/frameworks/#react) [Get an API key](https://email-validation.org/signin/)

- Status: Setup guide
- Two files you copy into your app

**form-guard/react** React 18 or 19

TSX

```text
import { FormGuard } from './form-guard/react';

<FormGuard browserKey="YOUR_BROWSER_KEY">
  <form action="/signup" method="post">
    <input type="email" name="email" />
    <button>Sign up</button>
  </form>
</FormGuard>
```

## At a glance.

- **Status**: **Setup guide.** Not listed on a marketplace yet: you set it up yourself in a few steps, below and in the full guide.
- **For**: Developers of React apps, Next.js and Remix included, who want a mistyped or dead address caught in the sign-up or contact form while the visitor can still fix it.
- **You need**: React 18 or 19, and a browser key made just for the site: only the Validate addresses permission, your site’s addresses as allowed origins, and a [daily credit cap](https://email-validation.org/docs/authentication/#limits).
- **Costs**: 1 credit = 1 validated address, as with any API request. Free: unknown results, API errors, malformed addresses, test addresses on sandbox.email-validation.org and, in a bulk list, repeats of an address (charged once).
- **Full guide**: [Read the full setup guide](https://email-validation.org/docs/form-guard/frameworks/#react)

## Typical uses.

- **Fix typos with one click**: A domain a letter or two away from a big mailbox provider gets a suggestion with the fixed address as a button. The fix is worked out in the browser and costs nothing.
- **Stop only what you choose**: invalid and disposable results stop the form by default, with a short message next to the field. Set stop to add catch\_all, or to stop nothing and keep only the typo fixes.
- **Forms sent from a click handler**: The component stops only real form submissions. If your app sends the form from a click handler, await check(field) there and go on unless stop is true.

## Set it up. 4 steps.

The short version of the [full setup guide](https://email-validation.org/docs/form-guard/frameworks/#react), which stays the reference when a step does not match what you see.

1. **Download the files**: There is no npm package yet: download the form guard files from the guide and copy core.ts and react.ts from the zip’s src/ folder into one folder of your app.
2. **Create a browser key**: Under API keys, click Create API key and pick “On a public web page” (browser key) under “Where will you use this key?”: such a key can only validate addresses. Add your site’s addresses and the address you test on as allowed origins, and a daily credit cap.
3. **Wrap your form**: Import `FormGuard` and put it around your form with your key in `browserKey`. Put `data-ev-guard="off"` on your log-in and password forms.
4. **Test it**: `no_mailbox@sandbox.email-validation.org` shows the message and stops the form, `likely_typo@sandbox.email-validation.org` also offers a fix, and `accepted@sandbox.email-validation.org` goes through, at no cost. On a form that mails the address, try only the ones that stop it.

## Good to know.

- Nothing runs during server rendering. Strict mode and route changes load the script once, and a form that unmounts is no longer guarded.
- The browser key sits in your page’s source, so treat it as public. Allowed origins stop other websites from using it in their visitors’ browsers; the daily credit cap is what limits the cost.
- No answer in time, a refused key, no credits left or any error: the field passes and the form submits. valid and unknown results always go through.
- The script is one per page, so give every FormGuard on a page the same settings. Once loaded, it guards every email field on the page, also outside the component, until the visitor leaves.
- A page that enforces Trusted Types adds `ev-form-guard` to its `trusted-types` directive; the [Content Security Policy](https://email-validation.org/docs/form-guard/#csp) entries are in the form guard docs.

## Related

- [The full React setup guide](https://email-validation.org/docs/form-guard/frameworks/#react)
- [Your key on a public page](https://email-validation.org/docs/form-guard/#key)
- [Every setting of the component](https://email-validation.org/docs/form-guard/frameworks/#settings)
- [Checking from your own code](https://email-validation.org/docs/form-guard/#api)
- [Slack integration](https://email-validation.org/integrations/slack/)
- [Snowflake integration](https://email-validation.org/integrations/snowflake/)
- [Svelte integration](https://email-validation.org/integrations/svelte/)
- [Vue integration](https://email-validation.org/integrations/vue/)
- [All integrations](https://email-validation.org/integrations/)
