Published on

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

Tags
Inbox Design

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

  1. Use w-96 to set an element to a fixed width(24rem).

  2. Control the horizontal margin of an element to auto using the mx-auto utilities.

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

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

  5. Control the padding on all sides of an element to 0.75rem using the p-3 utilities.

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

  7. Control the text color of an element to lg using the text-lg utilities.

  8. Control the padding on all sides of an element to 0.25rem using the p-1 utilities.

  9. Control the background color of an element to blue-500 using the bg-blue-500 utilities.

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

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

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

  13. Control the border color of an element to 0.5rem using the border-2 utilities.

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

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

  16. Use h-96 to set an element to a fixed height(24rem).

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

  18. Control the vertical padding of an element to 1rem using the py-4 utilities.

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

  20. Control the border color of an element to blue-500 using the border-blue-500 utilities.

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

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

  23. Control the margin on right side of an element to 0.5rem using the mr-2 utilities.

  24. Control the text color of an element to blue-500 using the text-blue-500 utilities.

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

  26. Control the vertical margin of an element to auto using the my-auto utilities.

  27. Control the margin on top side of an element to 0.25rem using the mt-1 utilities.

  28. Control the text color of an element to gray-500 using the text-gray-500 utilities.

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

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

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

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