Style User Management App with Tailwind CSS - Angular and Tailwind
we add basic styling to the User Management project using Tailwind CSS.
The goal is not high-quality UI, but to understand how Tailwind classes are used in Angular.
What we will style
- User List UI
- Add User Form
- Edit User Form
- Buttons and Inputs
Styling User List Container
We apply styles to the main wrapper div.
Tailwind classes used:
max-w-lg→ max widthshadow-md→ shadowm-4→ marginp-4→ paddingrounded-lg→ rounded corners
Example:
<div class="max-w-lg shadow-md m-4 p-4 rounded-lg">
Styling User List (ul)
Add spacing and text color.
<ul class="space-y-2 text-gray-700">
space-y-2→ vertical spacingtext-gray-700→ text color
Align Label & Value using Flex
Each list item uses flex + justify-between.
<li class="flex justify-between">
<span>Name</span>
<span>{{user.name}}</span>
</li>
Same pattern used for:
- Age
- ID
Styling Heading (User List)
<h1 class="text-2xl text-orange-600 text-center">
User List
</h1>
text-2xl→ font sizetext-orange-600→ colortext-center→ center align
Button Styling (Delete & Edit)
Buttons reused from user list.
<button class="bg-red-500 text-white p-1 rounded-md cursor-pointer">
Delete
</button>
<button class="bg-orange-500 text-white p-1 rounded-md cursor-pointer">
Edit
</button>
Styling Add User Form
Same wrapper style reused.
<div class="max-w-lg shadow-md m-4 p-4 rounded-lg">
Input Field Styling
<input
class="w-full border border-gray-300 rounded px-3 py-2 mb-4"
type="text"
placeholder="Enter Name"
/>
Classes meaning:
w-full→ full widthborder→ borderborder-gray-300→ border colorrounded→ rounded inputpx-3 py-2→ paddingmb-4→ margin bottom
Same style used for email and age inputs.
Styling Add / Update Button
<button class="bg-green-500 text-white p-2 rounded-md cursor-pointer">
Add User
</button>
Color can be changed as needed.