๐๐ป ์๋๋ ๊ธ์ฐ๊ธฐ ํ ๋ ๋ง์ด ์ฌ์ฉํ๋ ํผ ๋ถ๋ถ์ UI๋์์ธ์
๋๋ค.
Below is the UI design for the form section frequently used when writing.
๐๐ป tailwind๋ ์๋์ ์น์ฌ์ดํธ์ ๊ฒ์์ ํตํด์ ์์ธํ ๋ด์ฉ์ ํ์ธ ํ ์ ์์ต๋๋ค.
You can find detailed information about Tailwind by searching on the website below.
โ๏ธ npm run dev๋ก ์๋ฒ์คํ ํ ๋ธ๋ผ์ฐ์ ์์ http://localhost:3000/form-tailwind ๋๋ http://localhost:3000/form-css ๋ก ๋์์ธ์ ํ์ธ ํ ์ ์์ต๋๋ค.
After starting the server with npm run dev, you can view the design in your browser at http://localhost:3000/form-tailwind or http://localhost:3000/form-css.
https://tailwindcss.com/docs/installation/using-vite
๐๐ป ์ ์ฒด ์ฝ๋๋ ๊นํ๋ธ์์ ํ์ธ ํ ์ ์์ต๋๋ค.
You can find the full code on GitHub.
https://github.com/gideonslife01/flm-webui
๐ main
โ๏ธ ์ฝ๋ ์ ์ผ ์๋ถ๋ถ์ผ๋ก ๋ ์ด์์๊ณผ ๋ฐฐ๊ฒฝ์๋ฑ์ ์ค์ ํฉ๋๋ค.
Configure settings such as the layout and background color at the very top of the code.
โ๏ธ ์ฝ๋ / Code
# Tailwind
<main className="min-h-screen flex items-center justify-center bg-gray-50 p-4">
... ...
</main>
# CSS
<main className="form-page"> ... ... </main>
<style>{`
/* ์ ์ฒด ํ๋ฉด ๊ฐ์ด๋ฐ / flex center */
.form-page {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background-color: #f9fafb;
padding: 16px;
} ... ...
</style>
โ๏ธ ์ค๋ช / Description
— Tailwind
1)item-center()์ justify-center()๋ฅผ ์ฌ์ฉํ๊ธฐ ์ํด์ flex๋ฅผ ์ฌ์ฉํฉ๋๋ค.
Use flex to utilize item-center() and justify-center().
2)bg-gray-50์ ๋ฐฑ๊ทธ๋ผ์ด๋ ์ปฌ๋ฌ p-4๋ mainํ๊ทธ ํจ๋ฉ์ ์ ์ฉํฉ๋๋ค.bg-gray-50 applies the background color, and p-4 applies padding to the main tag.
3)min-h-screen๋ ์ต์๋์ด๋ก ํ๋ฉด ๋์ด๋งํผ์ ์ ์ฉํฉ๋๋ค.min-h-screen sets the minimum height to the height of the screen.
— CSS
1) Tailwind์ ๋์ผํ ์์๋ display: flext;, align-itmes: center;justify-content : center; ์
๋๋ค.
The elements equivalent to Tailwind are display: flex;, align-items: center;, and justify-content: center;.
2) CSS์์ ํจ๋ฉ์ padding:16px, ๋ฐฐ๊ฒฝ์์ background-color: #f9fafb;
In CSS, the padding is padding: 16px; and the background color is background-color: #f9fafb;.
3)CSS์์ min-h-screen์ min-height: 100vh; ์
๋๋ค.
In CSS, min-h-screen corresponds to min-height: 100vh;.
๐ input
โ๏ธ ํผ ์์๋ก ์ด๋ฆ ์ด๋ฉ์ผ ๋ถ๋ถ์
๋๋ค.
These are the name and email form elements.
โ๏ธ ์ฝ๋ / Code
# Tailwind
{/* ์ด๋ฆ / Name Input */}
<input
value={form.name}
onChange={(e) => setForm({...form, name: e.target.value})}
placeholder="ํ๊ธธ๋/John Doe"
className="w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all"
/>
{/* ์ด๋ฉ์ผ / Email Input */}
<input
type="email"
value={form.email}
onChange={(e) => setForm({...form, email: e.target.value})}
placeholder="example@email.com"
className="w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all"
/>
</div>
# CSS
{/* ์ด๋ฆ / Name Input */}
<input
value={form.name}
onChange={(e) => setForm({...form, name: e.target.value})}
placeholder="ํ๊ธธ๋/John Doe"
className="input"
/>
{/* ์ด๋ฉ์ผ / Email Input */}
<input
type="email"
value={form.email}
onChange={(e) => setForm({...form, email: e.target.value})}
placeholder="example@email.com"
className="input"
/>
<style>{` ... ...
/* ์
๋ ฅ์นธ / input */
.input {
width: 100%;
padding: 12px 16px;
background-color: #f9fafb;
border: 1px solid #e5e7eb;
border-radius: 12px;
font-size: 14px;
outline: none;
transition: all 0.2s;
box-sizing: border-box;
}
.input:focus {
background-color: white;
border-color: #3b82f6;
box-shadow: 0 0 0 2px rgba(59,130,246,0.3);
}
... ... `}</style>
โ๏ธ ์ค๋ช / Description
— Tailwind & CSS
1) ํฌ๊ธฐ์ ์ฌ๋ฐฑ / Size & Spacing
- w-full width: 100%
— ๋ถ๋ชจ ๋๋น ๊ฝ ์ฑ์ฐ๊ธฐ / Fill parent width - px-4 = padding-left: 16px; padding-right: 16px
— ์ข์ฐ ์์ชฝ ์ฌ๋ฐฑ / left and right inner margins - py-3 = padding-top: 12px; padding-bottom: 12px
— ์ ์๋ ์์ชฝ ์ฌ๋ฐฑ / Top and bottom inner margins
2) ์๊ณผ ํ ๋๋ฆฌ / Color & Border
- bg-gray-50 = background: #f9fafb
— ๊ฑฐ์ ํฐ์์ ๊ฐ๊น์ด ์ฐํ ํ์ / Light gray bordering on white - border = border-width: 1px
— ํ ๋๋ฆฌ ์ผ๊ธฐ / Turn on border - border-gray-200 = border-color: #e5e7eb
— ํ ๋๋ฆฌ ์ ์ฐํ ํ์ / Light gray border color - rounded-xl = border-radius: 12px
— ๋ชจ์๋ฆฌ ๋ฅ๊ธ๊ฒ / Round the corners - text-sm = font-size: 14px
— ๊ธ์ ์๊ฒ / Smaller text
3) ํฌ์ปค์ค – ๊ธ์ฐ๊ธฐ ์ํด์ input box๋ฅผ ํด๋ฆญ ํ์ ๋
Focus โ When clicking the input box to type
- focus:outline-none
— ํด๋ฆญํ ๋ ๋์ค๋ ๊ฒ์ ํ ๋๋ฆฌ ์์ ๊ธฐ / Remove the black border that appears when clicking - focus:ring-2
–ํ๋์ ๋น๋๋ ํ ๋๋ฆฌ 2px ์๊ธฐ๊ธฐ / Add a 2px glowing blue border. - focus:ring-blue-500
— ๊ทธ ๋น๋๋ ํ ๋๋ฆฌ ์์ ํ๋์์ผ๋ก ์ค์ / Set the glowing border color to blue. - focus:bg-white
— ํด๋ฆญํ๋ฉด ์ค์ ๋ ํ์ ๋ฐฐ๊ฒฝ์์์ธ ํ์์์ input box๋ฐฐ๊ฒฝ์์ด ํฐ์์ผ๋ก ๋ฐ๋
When clicked, the input box background color changes from the preset gray to white.
4)์ ๋๋ฉ์ด์ / Animation
- transition-all = transition: all 0.15s
— ์๊ณผ ๋ง์ด ๋ถ๋๋ฝ๊ฒ ์ ํ๋๊ฒ ์ค์ / Set the color and ring to transition smoothly.
๐ textarea
โ๏ธ ํผ ์์๋ก ๊ธ ์์ฑ ๋ถ๋ถ์
๋๋ค.
This is the section for writing posts using form elements.
โ๏ธ ์ฝ๋ / Code
# Tailwind
<textarea
value={form.message}
onChange={(e) => setForm({...form, message: e.target.value})}
placeholder="๋ฉ์์ง๋ฅผ ์
๋ ฅํ์ธ์/Please enter your message..."
rows={4}
className="w-full px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:bg-white transition-all resize-none"
/>
# CSS
<textarea
value={form.message}
onChange={(e) => setForm({...form, message: e.target.value})}
placeholder="๋ฉ์์ง๋ฅผ ์
๋ ฅํ์ธ์/Please enter your message..."
rows={4}
className="input textarea"
/>
<style>{` ... ...
/* ์
๋ ฅ์นธ / input */
.input {
width: 100%;
padding: 12px 16px;
background-color: #f9fafb;
border: 1px solid #e5e7eb;
border-radius: 12px;
font-size: 14px;
outline: none;
transition: all 0.2s;
box-sizing: border-box;
}
.input:focus {
background-color: white;
border-color: #3b82f6;
box-shadow: 0 0 0 2px rgba(59,130,246,0.3);
}
.textarea {
resize: none;
} ... ...
`}</style>
โ๏ธ ์ค๋ช / Description
— Tailwind & CSS
1)resize-none = resize: none;์ ์ ์ธํ๊ณค input ๊ณผ ๊ฐ์ต๋๋ค.resize-none is the same as input, except for resize: none;.
2)resize-none = resize: none;๋ textarea์ ํฌ๊ธฐ๋ฅผ ๋ง์ฐ์ค๋ก ์กฐ์ ํ ์ ์๊ฒ ์ ๊ทธ๋ ๊ธฐ๋ฅ์
๋๋ค.resize-none (or resize: none;) is a feature that locks a textarea’s size, preventing it from being adjusted with the mouse.
๐ Label
โ๏ธ ์ด๋ฆ,์ด๋ฉ์ผ ๋ถ๋ถ์ผ๋ก ๊ฐ ์์์ ํ
์คํธ ๋ผ๋ฒจ์ ํ์ํฉ๋๋ค.
Display text labels for each element, such as “Name” and “Email.”
โ๏ธ ์ฝ๋ / Code
# Tailwind
<label className="text-sm font-bold text-gray-700">์ด๋ฆ/Name</label>
# CSS
<label className="label">์ด๋ฆ/Name</label>
<style>{` ... ...
.label {
font-size: 14px;
font-weight: 700;
color: #374151;
}
... ... `}
</style>
โ๏ธ ์ค๋ช / Description
— Tailwind & CSS
1)text-sm
font-size: 14px
2)font-bold
font-weight: 700
3. text-gray-700
color: #374151
๐ ์คํฌ๋ฆฐ ์ท / ScreenShot


์ํ๋ณต์ 8์ฅ 32์ / John 8:32
“๊ทธ๋ฆฌ๊ณ ๋ํฌ๋ ์ง๋ฆฌ๋ฅผ ์๊ฒ ๋ ๊ฒ์ด๋ฉฐ, ์ง๋ฆฌ๊ฐ ๋ํฌ๋ฅผ ์์ ๋กญ๊ฒ ํ ๊ฒ์ด๋ค.”
“Then you will know the truth ,and the truth will set you free”