Published on

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

Inbox Ui

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 component

github.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

  1. Use h-screen to make an element span the entire height of the viewport.

  2. Use flex to create a block-level flex container.

  3. Use flex to create a block-level flex container.

  4. Use flex to create a block-level flex container.

  5. Control the horizontal padding of an element to 1rem using the px-4 utilities.

  6. Control the vertical padding of an element to 0.75rem using the py-3 utilities.

  7. Control the background color of an element to gray-800 using the bg-gray-800 utilities.

  8. Use w-64 to set an element to a fixed width(16rem).

  9. Use inline utilities to put the element on its own line and fill its parent.

  10. Use w-full to set an element to a 100% based width.

  11. Use h-8 to set an element to a fixed height(2rem).

  12. Use w-8 to set an element to a fixed width(2rem).

  13. Control the margin on left side of an element to 1rem using the ml-4 utilities.

  14. Control the text color of an element to sm using the text-sm utilities.

  15. Control the text color of an element to white using the text-white utilities.

  16. Control the margin on left side of an element to auto using the ml-auto utilities.

  17. Use h-6 to set an element to a fixed height(1.5rem).

  18. Use w-6 to set an element to a fixed width(1.5rem).

  19. Control the margin on left side of an element to 2.5rem using the ml-10 utilities.

  20. Control the text color of an element to gray-400 using the text-gray-400 utilities.

  21. Use flex to create a block-level flex container.

  22. Control the background color of an element to gray-700 using the bg-gray-700 utilities.

  23. Control the horizontal padding of an element to 1.5rem using the px-6 utilities.

  24. Control the background color of an element to gray-600 using the hover:bg-gray-600 utilities on hover.

  25. Use inline-block utilities to wrap the element to prevent the text inside from extending beyond its parent.

  26. Control the horizontal padding of an element to 0.75rem using the px-3 utilities.

  27. Control the vertical padding of an element to 0.5rem using the py-2 utilities.

  28. Control the margin on left side of an element to 0.5rem using the ml-2 utilities.

  29. Use relative to position an element according to the normal flow of the document.

  30. 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.

  31. Use the left-0 utilities to set the left position of a positioned element to 0rem.

  32. Use h-5 to set an element to a fixed height(1.25rem).

  33. Use w-5 to set an element to a fixed width(1.25rem).

  34. Control the horizontal padding of an element to 0.5rem using the px-2 utilities.

  35. Control the background color of an element to white using the focus:bg-white utilities on focus.

  36. Control the text color of an element to gray-900 on focus using the focus:text-gray-900 utilities.

  37. Set the left padding of the element to 2.5rem using the pl-10 utilities class

  38. Control the padding on right side of an element to 1rem using the pr-4 utilities.

  39. Control the background color of an element to gray-900 using the bg-gray-900 utilities.

  40. Control the margin on left side of an element to 1.5rem using the ml-6 utilities.

  41. Control the text color of an element to gray-200 on hover using the hover:text-gray-200 utilities.

  42. Control the padding on all sides of an element to 1.5rem using the p-6 utilities.

  43. Control the background color of an element to gray-100 using the bg-gray-100 utilities.

  44. Use overflow-y-auto to allow vertical scrolling if needed.

  45. Control the text color of an element to gray-600 using the text-gray-600 utilities.

  46. Control the margin on top side of an element to 0.75rem using the mt-3 utilities.

  47. Control the horizontal margin of an element to -0.75rem using the -mx-3 utilities.

  48. Control the vertical padding of an element to 0.25rem using the py-1 utilities.

  49. Control the background color of an element to gray-200 using the bg-gray-200 utilities.

  50. Control the text color of an element to gray-700 using the text-gray-700 utilities.

  51. Control the text color of an element to gray-900 using the text-gray-900 utilities.

  52. Control the text color of an element to center using the text-center utilities.

  53. Control the text color of an element to xs using the text-xs utilities.

  54. Control the background color of an element to gray-300 using the bg-gray-300 utilities.

  55. Control the background color of an element to gray-200 using the hover:bg-gray-200 utilities on hover.

  56. Control the margin on top side of an element to 2rem using the mt-8 utilities.

  57. Use overflow-hidden to clip any content within an element that overflows the bounds of that element.

  58. Control the border color of an element to l using the border-l utilities.

  59. Control the border color of an element to r using the border-r utilities.

  60. Control the border color of an element to b using the border-b utilities.

  61. Control the padding on top side of an element to 0.75rem using the pt-3 utilities.

  62. Control the padding on bottom side of an element to 1rem using the pb-4 utilities.

  63. Control the background color of an element to white using the bg-white utilities.

  64. Control the border color of an element to t using the border-t utilities.

  65. 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.

  66. Control the text color of an element to gray-800 using the text-gray-800 utilities.

  67. Control the background color of an element to green-300 using the bg-green-300 utilities.

  68. Control the padding on top side of an element to 1rem using the pt-4 utilities.

  69. 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.