# React

React (opens new window) is a JavaScript library for building user interfaces. EmailJS works with all modern frameworks, and React is no exception.

Below we show how to create the contact form components, ContactUs.js:

import React from 'react';
import emailjs from 'emailjs-com';

import './ContactUs.css';

export default function ContactUs() {

  function sendEmail(e) {

    emailjs.sendForm('YOUR_SERVICE_ID', 'YOUR_TEMPLATE_ID', e.target, 'YOUR_USER_ID')
      .then((result) => {
      }, (error) => {

  return (
    <form className="contact-form" onSubmit={sendEmail}>
      <input type="hidden" name="contact_number" />
      <input type="text" name="user_name" />
      <input type="email" name="user_email" />
      <textarea name="message" />
      <input type="submit" value="Send" />