- Published on
What You Need To Make A Sample Profile Page With Tailwind CSS

- What is Tailwind CSS?
- The description of Sample Profile Page ui component
- Why use Tailwind CSS to build a Sample Profile Page ui component?
- The preview of Sample Profile Page ui component
- The source code of Sample Profile Page ui component
- How to build a Sample Profile Page with Tailwind CSS?
- Install tailwind css of verion 2.2.4
- All the unility class needed to build a Sample Profile Page component
- 47 steps to build a Sample Profile Page component with Tailwind CSS
- Conclusion
What is Tailwind CSS?
Tailwind CSS is a utility-first CSS framework that focuses on creating personalized user interfaces quickly. It can gives you all the building blocks you are able to create personalized designs without having to fight to override irritating opinionated styles. Also, Tailwind CSS is a highly configurable, low-level CSS framework.
The description of Sample Profile Page ui component
Mobile profile page
Why use Tailwind CSS to build a Sample Profile Page ui component?
- It can make the building process of Sample Profile Page ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Sample Profile Page component file.
The preview of Sample Profile Page ui component
Free download of the Sample Profile Page's source code
The source code of Sample Profile Page ui component
<div class="min-h-screen flex flex-col max-w-md mx-auto bg-gray-200 opacity-100 font-poppins px-4 bg-no-repeat bg-cover bg-center">
<div class="flex justify-between px-1 pt-4 items-center">
<div>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M10.828 12l4.95 4.95-1.414 1.414L8 12l6.364-6.364 1.414 1.414z"/></svg>
</div>
<div>
<p class="font-semibold">My Profile</p>
</div>
<div>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M12 3c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 14c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"/></svg>
</div>
</div>
<div class="flex items-center px-4 pt-12 justify-between">
<div class="w-24 h-24 bg-blue-600 flex items-center rounded-full">
<img class="h-20 w-20 mx-auto" src="https://lnmlpexiwaspywjbwwvd.supabase.in/storage/v1/object/sign/assets/boy.png?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1cmwiOiJhc3NldHMvYm95LnBuZyIsImlhdCI6MTYzMzUzMzk2NywiZXhwIjoxOTQ4ODkzOTY3fQ.HL6DqbdJMCZI6dqEN-ZQAu5EwtblW7r8YNuud4_kHV8">
</div>
<div class="w-9/12 flex items-center">
<div class="w-10/12 flex flex-col leading-none pl-4">
<p class="text-2xl font-bold">Soefyan</p>
<p class="text-sm pt-1 font-light text-gray-700">Network Engineer</p>
</div>
<div class="w-2/12">
<div>
<svg xmlns="http://www.w3.org/2000/svg" class="text-gray-700" fill="currentColor" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M9.243 19H21v2H3v-4.243l9.9-9.9 4.242 4.244L9.242 19zm5.07-13.556l2.122-2.122a1 1 0 0 1 1.414 0l2.829 2.829a1 1 0 0 1 0 1.414l-2.122 2.121-4.242-4.242z"/></svg>
</div>
</div>
</div>
</div>
<div class="pt-12 px-4 w-full flex flex-col">
<p class="font-semibold text-gray-600">My Status</p>
<div class="flex w-full pt-2 space-x-2">
<button class="bg-gray-800 w-32 rounded-full px-4 py-2 font-ligth text-white flex">🤠 Away</button>
<button class="bg-green-800 w-32 rounded-full px-4 py-2 font-ligth text-white flex">🎮 Game</button>
<button class="bg-red-800 w-32 rounded-full px-4 py-2 font-ligth text-white flex">👷 Work</button>
</div>
</div>
<div class="pt-12 px-4 w-full flex flex-col">
<p class="font-semibold text-gray-600">Dashboard</p>
<div class="flex flex-col w-full pt-2 space-y-2">
<div class="flex w-full h-12">
<div class="w-2/12 h-full">
<div class="h-12 w-12 bg-green-600 rounded-full flex items-center">
<svg xmlns="http://www.w3.org/2000/svg" class="mx-auto text-white" fill="currentColor" viewBox="0 0 24 24" width="24" height="24"><path fill="none" d="M0 0h24v24H0z"/><path d="M2 9h19a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V9zm1-6h15v4H2V4a1 1 0 0 1 1-1zm12 11v2h3v-2h-3z"/></svg>
</div>
</div>
<div class="w-6/12 h-full flex items-start">
<p class="my-auto text-lg font-semibold">Payment</p>
</div>
<div class="w-4/12 h-full flex justify-end items-end">
<button class="flex bg-red-600 rounded-md my-auto px-5 py-1 float-right text-white font-medium">2 New</button>
</div>
</div>
</div>
</div>
</div>
<style>
.bg-gelap{
background-color: #001E26;
}
.bg-btn{
background-color: #FF6446;
}
</style>
How to build a Sample Profile Page with Tailwind CSS?
Install tailwind css of verion 2.2.4
Use the script
html tag to import the script of Tailwind CSS of the version 2.2.4
<script src="https://cdn.tailwindcss.com"></script>
All the unility class needed to build a Sample Profile Page component
min-h-screen
flex
flex-col
max-w-md
mx-auto
bg-gray-200
px-4
bg-no-repeat
bg-cover
bg-center
px-1
pt-4
pt-12
w-24
h-24
bg-blue-600
h-20
w-20
w-9/12
w-10/12
pl-4
text-2xl
text-sm
pt-1
text-gray-700
w-2/12
w-full
text-gray-600
pt-2
bg-gray-800
w-32
py-2
text-white
bg-green-800
bg-red-800
h-12
h-full
w-12
bg-green-600
w-6/12
my-auto
text-lg
w-4/12
bg-red-600
px-5
py-1
float-right
47 steps to build a Sample Profile Page component with Tailwind CSS
Set the minimum width/height of an element using the
min-h-screen
utilities.Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container.Set the maximum width/height of an element using the
max-w-md
utilities.Control the horizontal margin of an element to auto using the
mx-auto
utilities.Control the background color of an element to gray-200 using the
bg-gray-200
utilities.Control the horizontal padding of an element to 1rem using the
px-4
utilities.Control the background color of an element to no-repeat using the
bg-no-repeat
utilities.Control the background color of an element to cover using the
bg-cover
utilities.Control the background color of an element to center using the
bg-center
utilities.Control the horizontal padding of an element to 0.25rem using the
px-1
utilities.Control the padding on top side of an element to 1rem using the
pt-4
utilities.Control the padding on top side of an element to 3rem using the
pt-12
utilities.Use
w-24
to set an element to a fixed width(6rem).Use
h-24
to set an element to a fixed height(6rem).Control the background color of an element to blue-600 using the
bg-blue-600
utilities.Use
h-20
to set an element to a fixed height(5rem).Use
w-20
to set an element to a fixed width(5rem).Use
w-9/12
to set an element to a fixed width(9/12).Use
w-10/12
to set an element to a fixed width(10/12).Adjust the left padding of an element to 1rem using the
pl-4
utilities classControl the text color of an element to 2xl using the
text-2xl
utilities.Control the text color of an element to sm using the
text-sm
utilities.Control the padding on top side of an element to 0.25rem using the
pt-1
utilities.Control the text color of an element to gray-700 using the
text-gray-700
utilities.Use
w-2/12
to set an element to a fixed width(2/12).Use
w-full
to set an element to a 100% based width.Control the text color of an element to gray-600 using the
text-gray-600
utilities.Control the padding on top side of an element to 0.5rem using the
pt-2
utilities.Control the background color of an element to gray-800 using the
bg-gray-800
utilities.Use
w-32
to set an element to a fixed width(8rem).Control the vertical padding of an element to 0.5rem using the
py-2
utilities.Control the text color of an element to white using the
text-white
utilities.Control the background color of an element to green-800 using the
bg-green-800
utilities.Control the background color of an element to red-800 using the
bg-red-800
utilities.Use
h-12
to set an element to a fixed height(3rem).Use
h-full
to set an element’s height to 100% of its parent, as long as the parent has a defined height.Use
w-12
to set an element to a fixed width(3rem).Control the background color of an element to green-600 using the
bg-green-600
utilities.Use
w-6/12
to set an element to a fixed width(6/12).Control the vertical margin of an element to auto using the
my-auto
utilities.Control the text color of an element to lg using the
text-lg
utilities.Use
w-4/12
to set an element to a fixed width(4/12).Control the background color of an element to red-600 using the
bg-red-600
utilities.Control the horizontal padding of an element to 1.25rem using the
px-5
utilities.Control the vertical padding of an element to 0.25rem using the
py-1
utilities.Use
float-right
to float an element to the right of its container.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to build a Sample Profile Page components, learn and follow along to implement your own components.