Friday, 14 February 2025

1️⃣ Simple Method: Formspree (No Backend)

1️⃣ Simple Method: Formspree (No Backend)

import React, { useState } from "react"; function Contact() { const [status, setStatus] = useState(""); const handleSubmit = async (event) => { event.preventDefault(); const formData = new FormData(event.target); const response = await fetch("https://formspree.io/f/YOUR_FORM_ID", { method: "POST", body: formData, headers: { Accept: "application/json" }, }); if (response.ok) { setStatus("Thanks for your message!"); event.target.reset(); // Clear form after successful submission } else { setStatus("Oops! Something went wrong."); } }; return (
{/* Contact Info */}

Contact

Looking forward to hearing from you

  • Phone
  • 98575545525
  • Email
  • info@gmail.com
{/* Contact Form */}
{/* First & Last Name */}
{/* Email & Subject */}
{/* Message */} {/* Submit Button */} {/* Status Message */} {status &&

{status}

}
); } export default Contact;

No comments:

Post a Comment

3D card hover

 import { motion } from "framer-motion"; import React from "react"; const Card = ({ title, price, image }) => {   ret...