
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
react-netlify-forms
Advanced tools
React components and hooks giving you the power of Netlify Forms. Start building serverless forms on Netlify with React.
React components and hooks giving you the power of Netlify Forms. Start building serverless forms on Netlify with React. Honeypot fields and reCAPTCHA are included as ready-to-use components.
Go to documentation with live demo.
It gives you all the features of Netlify Forms as simple and reusable React components which have been tested on Netlify.
This component must be used with Server-Side Rendering (SSR) because Netlify
searches for a data-netlify
attribute on HTML form
tags to setup their
Forms backend for you.
Suggestions: Astro, Next.js, Remix or Vite
npm install --save react-netlify-forms
In the following example a contact form with two inputs and a honeypot for extra spam prevention is shown. It also works without JavaScript by falling back to a serverside-rendered form which just submits data with an usual POST request:
import React from 'react'
import { NetlifyForm, Honeypot } from 'react-netlify-forms'
const ContactForm = () => (
<NetlifyForm name='Contact' action='/thanks' honeypotName='bot-field'>
{({ handleChange, success, error }) => (
<>
<Honeypot />
{success && <p>Thanks for contacting us!</p>}
{error && (
<p>Sorry, we could not reach our servers. Please try again later.</p>
)}
<div>
<label htmlFor='name'>Name:</label>
<input type='text' name='name' id='name' onChange={handleChange} />
</div>
<div>
<label htmlFor='message'>Message:</label>
<textarea
type='text'
name='message'
id='message'
rows='4'
onChange={handleChange}
/>
</div>
<div>
<button type='submit'>Submit</button>
</div>
</>
)}
</NetlifyForm>
)
export default ContactForm
For more examples please browse through our website.
MIT © Björn Clees
Thanks to create-react-library for providing quick setup for NPM packages.
FAQs
React components and hooks giving you the power of Netlify Forms. Start building serverless forms on Netlify with React.
The npm package react-netlify-forms receives a total of 136 weekly downloads. As such, react-netlify-forms popularity was classified as not popular.
We found that react-netlify-forms demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.