Search

Tailwind - Form ์ž…๋ ฅํผ

Tailwind - Form ์ž…๋ ฅํผ

tailwind ๋ฅผ ์ด์šฉํ•˜์—ฌ ์ž…๋ ฅํผ UI ๋ฅผ ๋งŒ๋“ค์–ด๋ด…๋‹ˆ๋‹ค.
import React from 'react'; import MainLayout from '../../layouts/MainLayout'; const Form = () => { return ( <MainLayout> <div className="min-h-screen flex items-center justify-center bg-gray-100"> <div className="bg-white p-10 rounded-lg shadow-lg w-full max-w-lg"> <h2 className="text-2xl font-bold mb-6 text-gray-800 text-center">ํšŒ์›๊ฐ€์ž…</h2> <form> <div className="mb-4"> <label className="block text-gray-700 text-sm font-bold mb-2" htmlFor="username"> ์•„์ด๋”” </label> <input className="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="username" type="text" placeholder="์•„์ด๋””" /> </div> <div className="mb-4"> <label className="block text-gray-700 text-sm font-bold mb-2" htmlFor="password"> ๋น„๋ฐ€๋ฒˆํ˜ธ </label> <input className="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="password" type="password" placeholder="๋น„๋ฐ€๋ฒˆํ˜ธ" /> </div> <div className="mb-4"> <label className="block text-gray-700 text-sm font-bold mb-2" htmlFor="confirm-password"> ๋น„๋ฐ€๋ฒˆํ˜ธ ํ™•์ธ </label> <input className="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="confirm-password" type="password" placeholder="๋น„๋ฐ€๋ฒˆํ˜ธ ํ™•์ธ" /> </div> <div className="mb-4"> <label className="block text-gray-700 text-sm font-bold mb-2" htmlFor="name"> ์ด๋ฆ„ </label> <input className="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="name" type="text" placeholder="์ด๋ฆ„" /> </div> <div className="mb-4"> <label className="block text-gray-700 text-sm font-bold mb-2" htmlFor="phone"> ์ „ํ™”๋ฒˆํ˜ธ </label> <input className="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="phone" type="tel" placeholder="์ „ํ™”๋ฒˆํ˜ธ" /> </div> <div className="mb-4"> <label className="block text-gray-700 text-sm font-bold mb-2" htmlFor="email"> ์ด๋ฉ”์ผ </label> <input className="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="email" type="email" placeholder="์ด๋ฉ”์ผ" /> </div> <div className="mb-4"> <label for="country" class="block text-sm font-medium leading-6 text-gray-900">๊ตญ๊ฐ€</label> <div class="mt-2"> <select id="country" name="country" autocomplete="country-name" className="shadow border rounded w-full py-2 px-3 text-gray-700 focus:outline-none focus:shadow-outline"> <option>๋Œ€ํ•œ๋ฏผ๊ตญ</option> <option>๋ฏธ๊ตญ</option> <option>์ค‘๊ตญ</option> <option>์ผ๋ณธ</option> </select> </div> </div> <div className="mb-4"> <label className="block text-gray-700 text-sm font-bold mb-2" htmlFor="address"> ์ฃผ์†Œ </label> <input className="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" id="address" type="text" placeholder="์ฃผ์†Œ" /> </div> <div className="mb-4"> <label className="block text-gray-700 text-sm font-bold mb-2"> ์„ฑ๋ณ„ </label> <div className="flex gap-4"> <div className="flex items-center"> <input className="mr-2 leading-tight h-4 w-4 border-gray-300 text-indigo-600 focus:ring-indigo-600" type="radio" id="male" name="gender" value="male" /> <label className="text-gray-700" htmlFor="male"> ๋‚จ์„ฑ </label> </div> <div className="flex items-center"> <input className="mr-2 leading-tight h-4 w-4 border-gray-300 text-indigo-600 focus:ring-indigo-600" type="radio" id="female" name="gender" value="female" /> <label className="text-gray-700" htmlFor="female"> ์—ฌ์„ฑ </label> </div> </div> </div> <div className="mb-4"> <label className="block text-gray-700 text-sm font-bold mb-2"> ๊ฐœ์ธ์ •๋ณด ์ˆ˜์ง‘ ๋ฐ ์ด์šฉ ๋™์˜ </label> <div className="flex gap-4"> <div className="flex items-center"> <input className="mr-2 leading-tight h-4 w-4 border-gray-300 text-indigo-600 focus:ring-indigo-600" type="checkbox" id="agree" name="agree" value="male" /> <label className="text-gray-700" htmlFor="agree"> ๊ฐœ์ธ์ •๋ณด ์ˆ˜์ง‘,์ด์šฉ์— ๋™์˜ํ•˜์‹œ๊ฒ ์Šต๋‹ˆ๊นŒ? </label> </div> </div> </div> <div className="mb-6"> <button className="w-full bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" type="button" > ๊ฐ€์ž…ํ•˜๊ธฐ </button> </div> </form> </div> </div> </MainLayout> ); } export default Form;
JavaScript
๋ณต์‚ฌ