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
๋ณต์ฌ