Skip to content

Instantly share code, notes, and snippets.

@chrisfinazzo
Last active November 20, 2023 15:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisfinazzo/c5b80fbe252f2908194172309e78b0c7 to your computer and use it in GitHub Desktop.
Save chrisfinazzo/c5b80fbe252f2908194172309e78b0c7 to your computer and use it in GitHub Desktop.
React forms scratch
import React from "react";
const Form = () => (
<form action="https://formspree.io/f/{{$url}}" method="POST">
<h2 id="contact">Contact Me</h2>
<label htmlFor="fname">First Name</label><input type="text" className="field" name="firstname" placeholder="John" />
<label htmlFor="lname">Last Name</label><input type="text" className="field" name="lastname" placeholder="Smith" />
<label htmlFor="email">Email</label><input type="text" className="field" name="_replyto" placeholder="john.smith@example.com" /><label htmlFor="message">Message</label>
<textarea className="field" name="message" placeholder=""></textarea>
<input type="submit" name="submit" value="Submit" />
</form>
)
export default Form;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment