- Published on
Learn How To Create A Inbox Design With Tailwind CSS Like an Expert

- What is Tailwind CSS?
- The description of Inbox Design ui component
- Why use Tailwind CSS to build a Inbox Design ui component?
- The preview of Inbox Design ui component
- The source code of Inbox Design ui component
- How to build a Inbox Design with Tailwind CSS?
- Install tailwind css of verion 2.0.2
- All the unility class needed to build a Inbox Design component
- 32 steps to build a Inbox Design 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 Inbox Design ui component
Simple inbox design with some buttons and badge
Why use Tailwind CSS to build a Inbox Design ui component?
- It can make the building process of Inbox Design ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Inbox Design component file.
The preview of Inbox Design ui component
Free download of the Inbox Design's source code
The source code of Inbox Design ui component
<style>
body {background:white !important;}
</style>
<div class="w-96 mx-auto text-gray-700 rounded">
<div class="head flex border p-3 rounded-t">
<div class="title px-2 font-semibold text-lg">Inbox</div>
<div class="count border p-1 px-2 font-semibold bg-blue-500 text-white rounded-full text-xs cursor-pointer font-mono">2</div>
<div class="buttons ml-auto flex text-xs">
<div class="btn p-1 px-2 border-2 cursor-pointer rounded-full font-bold hover:bg-gray-100">...</div>
</div>
</div>
<div class="body border overflow-y-auto h-96">
<div class="messages">
<div class="msg px-4 py-4 border-l-2 border-blue-500 flex text-sm shadow-sm text-gray-600 cursor-pointer hover:bg-gray-100">
<div class="name font-medium mr-2 text-blue-500 flex-none">Jhon</div>
<div class="text my-auto mr-2">hellow there</div>
<div class="time text-xs mt-1 text-gray-500 font-thin flex-none ml-auto">1 hour ago</div>
</div>
<!-- each -->
<div class="msg px-4 py-4 border-l-2 border-blue-500 flex text-sm shadow-sm text-gray-600 cursor-pointer hover:bg-gray-100">
<div class="name font-medium mr-2 text-blue-500 flex-none">Jhon</div>
<div class="text my-auto mr-2">Lorem ipsum dolor sit amet consectetur adipisicing elit. Cum eum dignissimos incidunt? Voluptates, repellat. Consectetur optio ex odio at rem.</div>
<div class="time text-xs mt-1 text-gray-500 font-thin flex-none ml-auto">1 hour ago</div>
</div>
<!-- each -->
<div class="msg px-4 py-4 border-blue-500 flex text-sm shadow-sm text-gray-600 cursor-pointer hover:bg-gray-100">
<div class="name font-medium mr-2 text-blue-500 flex-none">Jhon</div>
<div class="text my-auto mr-2">hellow there</div>
<div class="time text-xs mt-1 text-gray-500 font-thin flex-none ml-auto">1 hour ago</div>
</div>
<!-- each -->
<div class="msg px-4 py-4 border-blue-500 flex text-sm shadow-sm text-gray-600 cursor-pointer hover:bg-gray-100">
<div class="name font-medium mr-2 text-blue-500 flex-none">Jhon</div>
<div class="text my-auto mr-2">hellow there</div>
<div class="time text-xs mt-1 text-gray-500 font-thin flex-none ml-auto">1 hour ago</div>
</div>
<!-- each -->
<div class="msg px-4 py-4 border-blue-500 flex text-sm shadow-sm text-gray-600 cursor-pointer hover:bg-gray-100">
<div class="name font-medium mr-2 text-blue-500 flex-none">Jhon</div>
<div class="text my-auto mr-2">hellow there</div>
<div class="time text-xs mt-1 text-gray-500 font-thin flex-none ml-auto">1 hour ago</div>
</div>
<!-- each -->
<div class="msg px-4 py-4 border-blue-500 flex text-sm shadow-sm text-gray-600 cursor-pointer hover:bg-gray-100">
<div class="name font-medium mr-2 text-blue-500 flex-none">Jhon</div>
<div class="text my-auto mr-2">hellow there</div>
<div class="time text-xs mt-1 text-gray-500 font-thin flex-none ml-auto">1 hour ago</div>
</div>
<!-- each -->
<div class="msg px-4 py-4 border-blue-500 flex text-sm shadow-sm text-gray-600 cursor-pointer hover:bg-gray-100">
<div class="name font-medium mr-2 text-blue-500 flex-none">Jhon</div>
<div class="text my-auto mr-2">hellow there</div>
<div class="time text-xs mt-1 text-gray-500 font-thin flex-none ml-auto">1 hour ago</div>
</div>
<!-- each -->
<div class="msg px-4 py-4 border-blue-500 flex text-sm shadow-sm text-gray-600 cursor-pointer hover:bg-gray-100">
<div class="name font-medium mr-2 text-blue-500 flex-none">Jhon</div>
<div class="text my-auto mr-2">hellow there</div>
<div class="time text-xs mt-1 text-gray-500 font-thin flex-none ml-auto">1 hour ago</div>
</div>
<!-- each -->
<div class="msg px-4 py-4 border-blue-500 flex text-sm shadow-sm text-gray-600 cursor-pointer hover:bg-gray-100">
<div class="name font-medium mr-2 text-blue-500 flex-none">Jhon</div>
<div class="text my-auto mr-2">hellow there</div>
<div class="time text-xs mt-1 text-gray-500 font-thin flex-none ml-auto">1 hour ago</div>
</div>
<!-- each -->
<div class="msg px-4 py-4 border-blue-500 flex text-sm shadow-sm text-gray-600 cursor-pointer hover:bg-gray-100">
<div class="name font-medium mr-2 text-blue-500 flex-none">Jhon</div>
<div class="text my-auto mr-2">hellow there</div>
<div class="time text-xs mt-1 text-gray-500 font-thin flex-none ml-auto">1 hour ago</div>
</div>
<!-- each -->
<div class="msg px-4 py-4 border-blue-500 flex text-sm shadow-sm text-gray-600 cursor-pointer hover:bg-gray-100">
<div class="name font-medium mr-2 text-blue-500 flex-none">Jhon</div>
<div class="text my-auto mr-2">hellow there</div>
<div class="time text-xs mt-1 text-gray-500 font-thin flex-none ml-auto">1 hour ago</div>
</div>
<!-- each -->
<div class="msg px-4 py-4 border-blue-500 flex text-sm shadow-sm text-gray-600 cursor-pointer hover:bg-gray-100">
<div class="name font-medium mr-2 text-blue-500 flex-none">Jhon</div>
<div class="text my-auto mr-2">hellow there</div>
<div class="time text-xs mt-1 text-gray-500 font-thin flex-none ml-auto">1 hour ago</div>
</div>
<!-- each -->
<div class="msg px-4 py-4 border-blue-500 flex text-sm shadow-sm text-gray-600 cursor-pointer hover:bg-gray-100">
<div class="name font-medium mr-2 text-blue-500 flex-none">Jhon</div>
<div class="text my-auto mr-2">hellow there</div>
<div class="time text-xs mt-1 text-gray-500 font-thin flex-none ml-auto">1 hour ago</div>
</div>
<!-- each -->
<div class="msg px-4 py-4 border-blue-500 flex text-sm shadow-sm text-gray-600 cursor-pointer hover:bg-gray-100">
<div class="name font-medium mr-2 text-blue-500 flex-none">Jhon</div>
<div class="text my-auto mr-2">hellow there</div>
<div class="time text-xs mt-1 text-gray-500 font-thin flex-none ml-auto">1 hour ago</div>
</div>
<!-- each -->
</div>
<div class="py-2 flex text-sm border text-gray-400 cursor-pointer bg-gray-100 hovay-200">
<div class="name font-m5dium text-blue-500 mx-auto flex-none">Show More</div>
</div>
<!-- load more -->
</div>
<div class="py-3 flex text-sm border text-gray-400 cursor-pointer bg-gray-100 hovay-200">
<div class="name font-m5dium text-blue-500 mx-auto flex-none">Open In New Tab</div>
</div>
<!-- open in new tab -->
</div>
How to build a Inbox Design with Tailwind CSS?
Install tailwind css of verion 2.0.2
Use the script
html tag to import the script of Tailwind CSS of the version 2.0.2
<script src="https://cdn.tailwindcss.com"></script>
All the unility class needed to build a Inbox Design component
w-96
mx-auto
text-gray-700
flex
p-3
px-2
text-lg
p-1
bg-blue-500
text-white
text-xs
ml-auto
border-2
hover:bg-gray-100
overflow-y-auto
h-96
px-4
py-4
border-l-2
border-blue-500
text-sm
text-gray-600
mr-2
text-blue-500
flex-none
my-auto
mt-1
text-gray-500
py-2
text-gray-400
bg-gray-100
py-3
32 steps to build a Inbox Design component with Tailwind CSS
Use
w-96
to set an element to a fixed width(24rem).Control the horizontal margin of an element to auto using the
mx-auto
utilities.Control the text color of an element to gray-700 using the
text-gray-700
utilities.Use
flex
to create a block-level flex container.Control the padding on all sides of an element to 0.75rem using the
p-3
utilities.Control the horizontal padding of an element to 0.5rem using the
px-2
utilities.Control the text color of an element to lg using the
text-lg
utilities.Control the padding on all sides of an element to 0.25rem using the
p-1
utilities.Control the background color of an element to blue-500 using the
bg-blue-500
utilities.Control the text color of an element to white using the
text-white
utilities.Control the text color of an element to xs using the
text-xs
utilities.Control the margin on left side of an element to auto using the
ml-auto
utilities.Control the border color of an element to 0.5rem using the
border-2
utilities.Control the background color of an element to gray-100 using the
hover:bg-gray-100
utilities on hover.Use
overflow-y-auto
to allow vertical scrolling if needed.Use
h-96
to set an element to a fixed height(24rem).Control the horizontal padding of an element to 1rem using the
px-4
utilities.Control the vertical padding of an element to 1rem using the
py-4
utilities.Control the border color of an element to l-2 using the
border-l-2
utilities.Control the border color of an element to blue-500 using the
border-blue-500
utilities.Control the text color of an element to sm using the
text-sm
utilities.Control the text color of an element to gray-600 using the
text-gray-600
utilities.Control the margin on right side of an element to 0.5rem using the
mr-2
utilities.Control the text color of an element to blue-500 using the
text-blue-500
utilities.Use
flex
to create a block-level flex container.Control the vertical margin of an element to auto using the
my-auto
utilities.Control the margin on top side of an element to 0.25rem using the
mt-1
utilities.Control the text color of an element to gray-500 using the
text-gray-500
utilities.Control the vertical padding of an element to 0.5rem using the
py-2
utilities.Control the text color of an element to gray-400 using the
text-gray-400
utilities.Control the background color of an element to gray-100 using the
bg-gray-100
utilities.Control the vertical padding of an element to 0.75rem using the
py-3
utilities.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to build a Inbox Design components, learn and follow along to implement your own components.