- Published on
Build A Inbox Ui With Tailwind CSS Like A Pro With The Help Of These 6 Tips

- What is Tailwind CSS?
- The description of Inbox Ui ui component
- Why use Tailwind CSS to create a Inbox Ui ui component?
- The preview of Inbox Ui ui component
- The source code of Inbox Ui ui component
- How to create a Inbox Ui with Tailwind CSS?
- Install tailwind css of verion 2.0.2
- All the unility class needed to create a Inbox Ui component
- 69 steps to create a Inbox Ui 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 Ui ui componentgithub.com/etienne-bobo/inboxui
Why use Tailwind CSS to create a Inbox Ui ui component?
- It can make the building process of Inbox Ui ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Inbox Ui component file.
The preview of Inbox Ui ui component
Free download of the Inbox Ui's source code
The source code of Inbox Ui ui component
<div class="h-screen flex flex-col">
<header class="flex flex-shrink-0">
<div class="flex-shrink-0 px-4 py-3 bg-gray-800 w-64">
<button class="flex items-center block w-full">
<img class="h-8 w-8 rounded-full object-cover"
src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=4&w=144&q=80"
alt="">
<span class="ml-4 text-sm font-medium text-white">Monica White</span>
<svg class=" ml-auto h-6 w-6 ml-10 stroke-current text-gray-400" viewBox="0 0 24 24" fill="none">
<path d="M16 10l-4 4-4-4" stroke="4A5568" stroke-width="2" stroke-linecap="round"
stroke-linejoin="round" />
</svg>
</button>
</div>
<div class="flex-1 flex bg-gray-700 px-6 items-center justify-between">
<nav>
<a href="#"
class="hover:bg-gray-600 rounded-lg bg-gray-800 inline-block text-sm font-medium text-white px-3 py-2 leading-none">MailBox</a>
<a href="#"
class="ml-2 hover:bg-gray-600 rounded-lg inline-block text-sm font-medium text-white px-3 py-2 leading-none">Customers</a>
<a href="#"
class="hover:bg-gray-600 rounded-lg inline-block text-sm font-medium text-white px-3 py-2 leading-none">Reporting</a>
<a href="#"
class="hover:bg-gray-600 rounded-lg inline-block text-sm font-medium text-white px-3 py-2 leading-none">Manage</a>
</nav>
<div class="flex items-center">
<span class="relative">
<span class="absolute inset-y-0 left-0 flex items-center">
<i class="fa fa-search h-5 w-5 px-2" style="color: gray;" aria-hidden="true"></i>
</span>
<input
class="focus:bg-white focus:text-gray-900 focus:placeholder-gray-700 pl-10 pr-4 py-2 leading-none block w-full bg-gray-900 rounded-lg text-sm placeholder-gray-400 text-white"
placeholder="Search">
</span>
<button class="ml-6 text-gray-400 hover:text-gray-200">
<i class="fa fa-bell-o h-5 w-5 fill-current" aria-hidden="true" style="color: #fff;"></i>
</button>
<button class="ml-6 text-gray-400 hover:text-gray-200">
<i class="fa fa-question-circle-o h-5 w-5 fill-current" aria-hidden="true"
style="color: #fff;"></i>
</button>
</div>
</div>
</header>
<div class="flex-1 flex overflow-x-hidden">
<div class="w-64 p-6 bg-gray-100 overflow-y-auto">
<nav>
<h2 class="font-semibold text-gray-600 uppercase tracking-wide">MailBoxes</h2>
<div class="mt-3">
<a href=""
class="-mx-3 py-1 px-3 text-sm font-medium flex items-center justify-between bg-gray-200 rounded-lg">
<span>
<i class="h-6 w-6 fa fa-envelope-o fill-current text-gray-700" aria-hidden="true"></i>
<span class=" text-gray-900">Inbox</span>
</span>
<span
class="inline-block px-4 py-1 text-center py-1 leading-none text-xs font-semibold text-gray-700 bg-gray-300 rounded-full">6</span>
</a>
</div>
<div class="mt-3">
<a href=""
class="-mx-3 py-1 px-3 text-sm font-medium flex items-center justify-between hover:bg-gray-200 rounded-lg">
<span>
<i class="h-6 w-6 fa fa-flag-o fill-current text-gray-700" aria-hidden="true"></i>
<span class=" text-gray-900">Flagged</span>
</span>
</a>
</div>
<div class="mt-3">
<a href=""
class="-mx-3 py-1 px-3 text-sm font-medium flex items-center justify-between hover:bg-gray-200 rounded-lg">
<span>
<i class="h-6 w-6 fa fa-pencil-square-o fill-current text-gray-700"
aria-hidden="true"></i>
<span class=" text-gray-900">Drafts</span>
</span>
<span
class="inline-block px-4 py-1 text-center py-1 leading-none text-xs font-semibold text-gray-700 bg-gray-300 rounded-full">2</span>
</a>
</div>
<div class="mt-3">
<a href=""
class="-mx-3 py-1 px-3 text-sm font-medium flex items-center justify-between hover:bg-gray-200 rounded-lg">
<span>
<i class="h-6 w-6 fa fa-user-o fill-current text-gray-700" aria-hidden="true"></i>
<span class=" text-gray-900">Assigned</span>
</span>
<span
class="inline-block px-4 py-1 text-center py-1 leading-none text-xs font-semibold text-gray-700 bg-gray-300 rounded-full">1</span>
</a>
</div>
<div class="mt-3">
<a href=""
class="-mx-3 py-1 px-3 text-sm font-medium flex items-center justify-between hover:bg-gray-200 rounded-lg">
<span>
<i class="h-6 w-6 fa fa-check-circle-o fill-current text-gray-700"
aria-hidden="true"></i>
<span class=" text-gray-900">Closed</span>
</span>
</a>
</div>
<div class="mt-3">
<a href=""
class="-mx-3 py-1 px-3 text-sm font-medium flex items-center justify-between hover:bg-gray-200 rounded-lg">
<span>
<i class="h-6 w-6 fa fa-trash-o fill-current text-gray-700" aria-hidden="true"></i>
<span class=" text-gray-900">Junk</span>
</span>
</a>
</div>
<div class="mt-8">
<h2 class="font-semibold text-gray-600 uppercase tracking-wide">Folders</h2>
<div class="mt-3">
<a href=""
class="-mx-3 py-1 px-3 text-sm font-medium flex items-center justify-between hover:bg-gray-200 rounded-lg">
<span class=" text-gray-900">Refunds</span>
</a>
</div>
<div class="mt-3">
<a href=""
class="-mx-3 py-1 px-3 text-sm font-medium flex items-center justify-between hover:bg-gray-200 rounded-lg">
<span class=" text-gray-900">Discounts</span>
</a>
</div>
<div class="mt-3">
<a href=""
class="-mx-3 py-1 px-3 text-sm font-medium flex items-center justify-between hover:bg-gray-200 rounded-lg">
<span class=" text-gray-900">Bugs</span>
</a>
</div>
</div>
</nav>
</div>
<main class=" flex bg-gray-200">
<div class="overflow-y-auto overflow-hidden">
<div class="px-4 py-2 flex items-center justify-between border-l border-r border-b">
<button class="text-sm flex items-center font-semibold text-gray-600">
<span>Sorted by Date</span>
<i class="ml-2 fa fa-angle-down justify-between" aria-hidden="true"></i>
</button>
<button class="text-sm flex items-center font-semibold text-gray-600">
<i class="fa fa-bars" aria-hidden="true"></i>
</button>
</div>
<div class="pt-3 pb-4 ">
<a href="#" class="block bg-white py-3 border-t">
<div class="px-4 py-2 flex justify-between">
<span class="text-sm font-semibold text-gray-900">Gloria Roberston</span>
<span class="text-sm font-semibold text-gray-600">2 days ago</span>
</div>
<span class="text-sm font-semibold text-gray-900 px-4 py-2">Refund</span>
<p class="px-4 py-2 text-sm font-semibold text-gray-700"">Lorem ipsum dolor sit amet consectetur adipisicing <br> dolor sit sit elo amet consectetur adipisicin elit....</p>
</a>
<a href="#" class="block bg-white py-3 border-t">
<div class="px-4 py-2 flex justify-between">
<span class="text-sm font-semibold text-gray-900">Gloria Roberston</span>
<span class="text-sm font-semibold text-gray-600">2 days ago</span>
</div>
<span class="text-sm font-semibold text-gray-900 px-4 py-2">Refund</span>
<p class="px-4 py-2 text-sm font-semibold text-gray-700"">Lorem ipsum dolor sit amet consectetur adipisicing <br> dolor sit sit elo amet consectetur adipisicin elit....</p>
</a>
<a href="#" class="block bg-white py-3 border-t">
<div class="px-4 py-2 flex justify-between">
<span class="text-sm font-semibold text-gray-900">Gloria Roberston</span>
<span class="text-sm font-semibold text-gray-600">2 days ago</span>
</div>
<span class="text-sm font-semibold text-gray-900 px-4 py-2">Refund</span>
<p class="px-4 py-2 text-sm font-semibold text-gray-700"">Lorem ipsum dolor sit amet consectetur adipisicing <br> dolor sit sit elo amet consectetur adipisicin elit....</p>
</a>
<a href="#" class="block bg-white py-3 border-t">
<div class="px-4 py-2 flex justify-between">
<span class="text-sm font-semibold text-gray-900">Gloria Roberston</span>
<span class="text-sm font-semibold text-gray-600">2 days ago</span>
</div>
<span class="text-sm font-semibold text-gray-900 px-4 py-2">Refund</span>
<p class="px-4 py-2 text-sm font-semibold text-gray-700"">Lorem ipsum dolor sit amet consectetur adipisicing <br> dolor sit sit elo amet consectetur adipisicin elit....</p>
</a>
</div>
</div>
<div class="flex flex-col py-3 w-auto inline-block overflow-y-auto overflow-hidden bg-gray-100">
<div class="flex justify-between ">
<button>
<i class="px-3 fa fa-reply text-sm font-semibold text-gray-600" aria-hidden="true"></i>
<i class="px-3 fa fa-tag text-sm font-semibold text-gray-600" aria-hidden="true"></i>
<i class="px-3 fa fa-user-circle text-sm font-semibold text-gray-600" aria-hidden="true"></i>
<i class="px-3 fa fa-inbox text-sm font-semibold text-gray-600" aria-hidden="true"></i>
<i class="fa fa-ellipsis-h text-sm font-semibold text-gray-600" aria-hidden="true"></i>
</button>
<button>
<i class="fa fa-angle-down text-sm font-semibold text-gray-600" aria-hidden="true"></i>
<i class="px-4 fa fa-angle-up text-sm font-semibold text-gray-600" aria-hidden="true"></i>
</button>
</div>
<div class="shadow-lg">
<div class="pt-3 pb-4 ">
<a href="#" class="block bg-white py-3 border-t">
<div class="px-4 py-2 flex justify-between">
<span>Re: Student Discount?</span>
<div>
<span class="px-3 text-sm font-semibold">#1428</span>
<span class="text-sm font-semibold px-4 py-1 text-gray-800 rounded-full bg-green-300">Active</span>
</div>
</div>
</a>
</div>
</div>
<div>
<div class="shadow-lg pt-4 ml-2 mr-2 rounded-lg">
<a href="#" class="block bg-white py-3 border-t pb-4">
<div class="px-4 py-2 flex justify-between">
<span class="text-sm font-semibold text-gray-900">Gloria Roberston</span>
<div class="flex">
<span class="px-4 text-sm font-semibold text-gray-600"> yesterday</span>
<img class="h-6 w-6 rounded-full object-cover"
src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=4&w=144&q=80"
alt="">
</div>
</div>
<p class="px-4 py-2 text-sm font-semibold text-gray-700"">Lorem mmmmm ipsum dolor sit amet consectetur adipisicing elit. Iusto adipisci laudantium <br> iste delectus explicabo id molestiae cupiditate corrupti distinctio alias. <br> Temporibus quae tenetur quod cupiditate, nostrum tempore inventore maxime ut! </p>
</a>
</div>
<div class="shadow-lg pt-4 ml-2 mr-2 rounded-lg">
<a href="#" class="block bg-white py-3 border-t pb-4">
<div class="px-4 py-2 flex justify-between">
<span class="text-sm font-semibold text-gray-900">Gloria Roberston</span>
<div class="flex">
<span class="px-4 text-sm font-semibold text-gray-600"> yesterday</span>
<img class="h-6 w-6 rounded-full object-cover"
src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=4&w=144&q=80"
alt="">
</div>
</div>
<p class="px-4 py-2 text-sm font-semibold text-gray-700"">Lorem mmmmm ipsum dolor sit amet consectetur adipisicing elit. Iusto adipisci laudantium <br> iste delectus explicabo id molestiae cupiditate corrupti distinctio alias. <br> Temporibus quae tenetur quod cupiditate, nostrum tempore inventore maxime ut! </p>
</a>
</div>
<div class="shadow-lg pt-4 ml-2 mr-2 rounded-lg">
<a href="#" class="block bg-white py-3 border-t pb-4">
<div class="px-4 py-2 flex justify-between">
<span class="text-sm font-semibold text-gray-900">Gloria Roberston</span>
<div class="flex">
<span class="px-4 text-sm font-semibold text-gray-600"> yesterday</span>
<img class="h-6 w-6 rounded-full object-cover"
src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=4&w=144&q=80"
alt="">
</div>
</div>
<p class="px-4 py-2 text-sm font-semibold text-gray-700"">Lorem mmmmm ipsum dolor sit amet consectetur adipisicing elit. Iusto adipisci laudantium <br> iste delectus explicabo id molestiae cupiditate corrupti distinctio alias. <br> Temporibus quae tenetur quod cupiditate, nostrum tempore inventore maxime ut! </p>
</a>
</div>
<div class="shadow-lg pt-4 ml-2 mr-2 rounded-lg">
<a href="#" class="block bg-white py-3 border-t pb-4">
<div class="px-4 py-2 flex justify-between">
<span class="text-sm font-semibold text-gray-900">Gloria Roberston</span>
<div class="flex">
<span class="px-4 text-sm font-semibold text-gray-600"> yesterday</span>
<img class="h-6 w-6 rounded-full object-cover"
src="https://images.unsplash.com/photo-1438761681033-6461ffad8d80?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=4&w=144&q=80"
alt="">
</div>
</div>
<p class="px-4 py-2 text-sm font-semibold text-gray-700"">Lorem mmmmm ipsum dolor sit amet consectetur adipisicing elit. Iusto adipisci laudantium <br> iste delectus explicabo id molestiae cupiditate corrupti distinctio alias. <br> Temporibus quae tenetur quod cupiditate, nostrum tempore inventore maxime ut! </p>
</a>
</div>
</div>
</div>
</main>
</div>
</div>
How to create a Inbox Ui 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 create a Inbox Ui component
h-screen
flex
flex-col
flex-shrink-0
px-4
py-3
bg-gray-800
w-64
block
w-full
h-8
w-8
ml-4
text-sm
text-white
ml-auto
h-6
w-6
ml-10
text-gray-400
flex-1
bg-gray-700
px-6
hover:bg-gray-600
inline-block
px-3
py-2
ml-2
relative
absolute
left-0
h-5
w-5
px-2
focus:bg-white
focus:text-gray-900
pl-10
pr-4
bg-gray-900
ml-6
hover:text-gray-200
p-6
bg-gray-100
overflow-y-auto
text-gray-600
mt-3
-mx-3
py-1
bg-gray-200
text-gray-700
text-gray-900
text-center
text-xs
bg-gray-300
hover:bg-gray-200
mt-8
overflow-hidden
border-l
border-r
border-b
pt-3
pb-4
bg-white
border-t
w-auto
text-gray-800
bg-green-300
pt-4
mr-2
69 steps to create a Inbox Ui component with Tailwind CSS
Use
h-screen
to make an element span the entire height of the viewport.Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container.Control the horizontal padding of an element to 1rem using the
px-4
utilities.Control the vertical padding of an element to 0.75rem using the
py-3
utilities.Control the background color of an element to gray-800 using the
bg-gray-800
utilities.Use
w-64
to set an element to a fixed width(16rem).Use
inline
utilities to put the element on its own line and fill its parent.Use
w-full
to set an element to a 100% based width.Use
h-8
to set an element to a fixed height(2rem).Use
w-8
to set an element to a fixed width(2rem).Control the margin on left side of an element to 1rem using the
ml-4
utilities.Control the text color of an element to sm using the
text-sm
utilities.Control the text color of an element to white using the
text-white
utilities.Control the margin on left side of an element to auto using the
ml-auto
utilities.Use
h-6
to set an element to a fixed height(1.5rem).Use
w-6
to set an element to a fixed width(1.5rem).Control the margin on left side of an element to 2.5rem using the
ml-10
utilities.Control the text color of an element to gray-400 using the
text-gray-400
utilities.Use
flex
to create a block-level flex container.Control the background color of an element to gray-700 using the
bg-gray-700
utilities.Control the horizontal padding of an element to 1.5rem using the
px-6
utilities.Control the background color of an element to gray-600 using the
hover:bg-gray-600
utilities on hover.Use
inline-block
utilities to wrap the element to prevent the text inside from extending beyond its parent.Control the horizontal padding of an element to 0.75rem using the
px-3
utilities.Control the vertical padding of an element to 0.5rem using the
py-2
utilities.Control the margin on left side of an element to 0.5rem using the
ml-2
utilities.Use
relative
to position an element according to the normal flow of the document.Use
absolute
to position an element outside of the normal flow of the document, causing neighboring elements to act as if the element doesn’t exist.Use the
left-0
utilities to set the left position of a positioned element to 0rem.Use
h-5
to set an element to a fixed height(1.25rem).Use
w-5
to set an element to a fixed width(1.25rem).Control the horizontal padding of an element to 0.5rem using the
px-2
utilities.Control the background color of an element to white using the
focus:bg-white
utilities on focus.Control the text color of an element to gray-900 on focus using the
focus:text-gray-900
utilities.Set the left padding of the element to 2.5rem using the
pl-10
utilities classControl the padding on right side of an element to 1rem using the
pr-4
utilities.Control the background color of an element to gray-900 using the
bg-gray-900
utilities.Control the margin on left side of an element to 1.5rem using the
ml-6
utilities.Control the text color of an element to gray-200 on hover using the
hover:text-gray-200
utilities.Control the padding on all sides of an element to 1.5rem using the
p-6
utilities.Control the background color of an element to gray-100 using the
bg-gray-100
utilities.Use
overflow-y-auto
to allow vertical scrolling if needed.Control the text color of an element to gray-600 using the
text-gray-600
utilities.Control the margin on top side of an element to 0.75rem using the
mt-3
utilities.Control the horizontal margin of an element to -0.75rem using the
-mx-3
utilities.Control the vertical padding of an element to 0.25rem using the
py-1
utilities.Control the background color of an element to gray-200 using the
bg-gray-200
utilities.Control the text color of an element to gray-700 using the
text-gray-700
utilities.Control the text color of an element to gray-900 using the
text-gray-900
utilities.Control the text color of an element to center using the
text-center
utilities.Control the text color of an element to xs using the
text-xs
utilities.Control the background color of an element to gray-300 using the
bg-gray-300
utilities.Control the background color of an element to gray-200 using the
hover:bg-gray-200
utilities on hover.Control the margin on top side of an element to 2rem using the
mt-8
utilities.Use
overflow-hidden
to clip any content within an element that overflows the bounds of that element.Control the border color of an element to l using the
border-l
utilities.Control the border color of an element to r using the
border-r
utilities.Control the border color of an element to b using the
border-b
utilities.Control the padding on top side of an element to 0.75rem using the
pt-3
utilities.Control the padding on bottom side of an element to 1rem using the
pb-4
utilities.Control the background color of an element to white using the
bg-white
utilities.Control the border color of an element to t using the
border-t
utilities.The
w-auto
utility can be useful if you need to remove an element’s assigned width under a specific condition, like at a particular breakpoint.Control the text color of an element to gray-800 using the
text-gray-800
utilities.Control the background color of an element to green-300 using the
bg-green-300
utilities.Control the padding on top side of an element to 1rem using the
pt-4
utilities.Control the margin on right side of an element to 0.5rem using the
mr-2
utilities.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to create a Inbox Ui components, learn and follow along to implement your own components.