Published on

Learn How To Build A Facebook Mobile Profile With Tailwind CSS Like an Expert

Tags
Facebook Mobile Profile

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 Facebook Mobile Profile ui component

Facebook mobile profile

Why use Tailwind CSS to make a Facebook Mobile Profile ui component?

  • It can make the building process of Facebook Mobile Profile ui component faster and more easily.
  • Enables building complex responsive layouts and components freely.
  • Minimum lines of CSS code in Facebook Mobile Profile component file.

The preview of Facebook Mobile Profile ui component

Free download of the Facebook Mobile Profile's source code

The source code of Facebook Mobile Profile ui component

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w==" crossorigin="anonymous" referrerpolicy="no-referrer" /><div class="flex justify-center">
  
  <div class="w-full md:w-3/5 bg-white p-6">
    <div class="flex items-center border-b py-4">
      <div>
        <i class="fas fa-chevron-left text-lg"></i>
      </div>
      <div class="flex-1">
        <p class="text-center">Joshua Welford</p>
      </div>
      <div>
        <i class="fas fa-pencil-alt"></i>
      </div>
      <div class="ml-4">
        <i class="fas fa-search"></i>
      </div>
    </div>
    <div class="mt-6">
      <div class="h-48 overflow-hidden rounded-tl-lg rounded-tr-lg">
        <img class="rounded-tl-xl rounded-tr-xl" src="https://pbs.twimg.com/profile_banners/607109926/1622322022/1500x500" />
      </div>
    </div>
    <div class="-mt-24">
      <div class="flex justify-center rounded-full">
        <img class="w-32 rounded-full" src="https://scontent-iad3-2.xx.fbcdn.net/v/t1.6435-9/195080787_3069500069997336_8089110405115182844_n.jpg?_nc_cat=101&ccb=1-3&_nc_sid=09cbfe&_nc_ohc=-mLpFQvyElMAX9XI6Ca&_nc_ht=scontent-iad3-2.xx&oh=5437bb06a33c393b57300424d4704102&oe=6127FF5F" />
      </div>
    </div>
    <div class="mt-2 text-lg">
      <p class="text-center"><span class="font-bold">Joshua Welford</span> (Welfordian)</p>
    </div>
    <div class="mt-2 flex justify-center text-lg">
      <p class="text-center w-5/6">Software Engineer working on an EMR system for a non-profit.</p>
    </div>
    <div class="flex pb-4 mt-4 items-center border-b">
      <button class="py-2 rounded flex-1 bg-blue-500 text-white">
        <i class="fas fa-plus-circle"></i> Add to Story
      </button>
      <button class="bg-gray-200 py-2 px-4 rounded ml-2">
        <i class="fas fa-ellipsis-h"></i>
    </div>
    <div>
      <div class="flex mt-2 items-center">
        <div class="text-gray-400">
          <i class="fas fa-graduation-cap"></i>
        </div>

        <div class="text-lg ml-3">
          <p>Studied Forensics at <span class="font-bold">Redcar & Cleveland College</span></p>
          </div>
        </div>
      </div>

      <div class="flex mt-2 items-center">
        <div class="text-gray-400">
          <i class="fas fa-graduation-cap"></i>
        </div>

        <div class="text-lg ml-3">
          <p>Went to Redcar Academy</p>
        </div>
      </div>
      
      <div class="flex mt-2 items-center">
        <div class="text-gray-400">
          <i class="fas fa-home"></i>
        </div>

        <div class="text-lg ml-3">
          <p>Lives in <span class="font-bold">Frederick, Maryland</span></p>
        </div>
      </div>
      
      <div class="flex mt-2 items-center">
        <div class="text-gray-400">
          <i class="fas fa-rss"></i>
        </div>

        <div class="text-lg ml-3">
          <p>Followed by 28 people</p>
        </div>
      </div>
      
      <div class="flex mt-2 items-center">
        <div class="text-gray-400">
          <i class="fas fa-link"></i>
        </div>

        <div class="text-lg ml-3">
          <p>welford.me</p>
        </div>
      </div>
    </div>
  </div>

How to make a Facebook Mobile Profile 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 make a Facebook Mobile Profile component

  • flex
  • w-full
  • md:w-3/5
  • bg-white
  • p-6
  • border-b
  • py-4
  • text-lg
  • flex-1
  • text-center
  • ml-4
  • mt-6
  • h-48
  • overflow-hidden
  • -mt-24
  • w-32
  • mt-2
  • w-5/6
  • pb-4
  • mt-4
  • py-2
  • bg-blue-500
  • text-white
  • bg-gray-200
  • px-4
  • ml-2
  • text-gray-400
  • ml-3

28 steps to make a Facebook Mobile Profile component with Tailwind CSS

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

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

  3. Use md:w-3/5 to set an element to a fixed width(3/5) at only medium screen sizes.

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

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

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

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

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

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

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

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

  12. Control the margin on top side of an element to 1.5rem using the mt-6 utilities.

  13. Use h-48 to set an element to a fixed height(12rem).

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

  15. Control the margin on top side of an element to -6rem using the -mt-24 utilities.

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

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

  18. Use w-5/6 to set an element to a fixed width(5/6).

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

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

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

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

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

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

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

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

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

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

Conclusion

The above is a step-by-step tutorial on how to use Tailwind CSS to make a Facebook Mobile Profile components, learn and follow along to implement your own components.