Last active
September 20, 2022 06:12
-
-
Save bicky-tmg/63ba8b0fe666b48527b8856df77fdd8b to your computer and use it in GitHub Desktop.
Boilerplate code for form component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
const Form = () => { | |
return ( | |
<form className="px-8 pt-6 pb-8 mb-4"> | |
<div className="mb-4 md:flex md:justify-between"> | |
<div className="mb-4 md:mr-2 md:mb-0"> | |
<label | |
className="block mb-2 text-sm font-bold text-gray-700" | |
htmlFor="firstName" | |
> | |
First Name | |
</label> | |
<input | |
className="w-full px-3 py-2 text-sm leading-tight text-gray-700 border rounded appearance-none focus:outline-none focus:shadow-outline" | |
id="firstName" | |
type="text" | |
placeholder="First Name" | |
/> | |
</div> | |
<div className="md:ml-2"> | |
<label | |
className="block mb-2 text-sm font-bold text-gray-700" | |
htmlFor="lastName" | |
> | |
Last Name | |
</label> | |
<input | |
className="w-full px-3 py-2 text-sm leading-tight text-gray-700 border rounded appearance-none focus:outline-none focus:shadow-outline" | |
id="lastName" | |
type="text" | |
placeholder="Last Name" | |
/> | |
</div> | |
</div> | |
<div className="mb-4"> | |
<label | |
className="block mb-2 text-sm font-bold text-gray-700" | |
htmlFor="email" | |
> | |
</label> | |
<input | |
className="w-full px-3 py-2 text-sm leading-tight text-gray-700 border rounded appearance-none focus:outline-none focus:shadow-outline" | |
id="email" | |
type="email" | |
placeholder="Email" | |
/> | |
</div> | |
<div className="mb-4 md:flex md:justify-between"> | |
<div className="mb-4 md:mr-2 md:mb-0"> | |
<label | |
className="block mb-2 text-sm font-bold text-gray-700" | |
htmlFor="password" | |
> | |
Password | |
</label> | |
<input | |
className="w-full px-3 py-2 text-sm leading-tight text-gray-700 border rounded appearance-none focus:outline-none focus:shadow-outline" | |
id="password" | |
type="password" | |
/> | |
</div> | |
<div className="md:ml-2"> | |
<label | |
className="block mb-2 text-sm font-bold text-gray-700" | |
htmlFor="c_password" | |
> | |
Confirm Password | |
</label> | |
<input | |
className="w-full px-3 py-2 text-sm leading-tight text-gray-700 border rounded appearance-none focus:outline-none focus:shadow-outline" | |
id="c_password" | |
type="password" | |
/> | |
</div> | |
</div> | |
<div className="mb-4"> | |
<input type="checkbox" id="terms" /> | |
<label | |
htmlFor="terms" | |
className="ml-2 mb-2 text-sm font-bold text-gray-700" | |
> | |
Accept Terms & Conditions | |
</label> | |
</div> | |
<div className="mb-6 text-center"> | |
<button | |
className="w-full px-4 py-2 font-bold text-white bg-blue-500 rounded-full hover:bg-blue-700 focus:outline-none focus:shadow-outline" | |
type="submit" | |
> | |
Register Account | |
</button> | |
</div> | |
<hr className="mb-6 border-t" /> | |
<div className="text-center"> | |
<a | |
className="inline-block text-sm text-blue-500 align-baseline hover:text-blue-800" | |
href="#" | |
> | |
Forgot Password? | |
</a> | |
</div> | |
<div className="text-center"> | |
<a | |
className="inline-block text-sm text-blue-500 align-baseline hover:text-blue-800" | |
href="#" | |
> | |
Already have an account? Login! | |
</a> | |
</div> | |
</form> | |
); | |
}; | |
export default Form; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment