Published on

6 Easy Ways To Build A Example Profile With Tailwind CSS Without Even Thinking About It

Tags
Example 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 Example Profile ui component

This is a design profile example

Why use Tailwind CSS to make a Example Profile ui component?

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

The preview of Example Profile ui component

Free download of the Example Profile's source code

The source code of Example Profile ui component

<!-- This is an example component -->
<div class="w-11/12">
    <div class="flex justify-center pb-10">
            <img src="https://images.pexels.com/photos/3278968/pexels-photo-3278968.jpeg?auto=compress&cs=tinysrgb&h=750&w=1260"
                class="h-40 w-40 rounded-full object-cover"
                alt="username"/>
            <div class="ml-10">
                <div class="flex items-center">
                    <h2 class="block leading-relaxed font-light text-gray-700 text-3xl">Darcy</h2>
                    <a class="cursor-pointer h-7 px-3 ml-3 outline-none border-transparent text-center rounded border bg-blue-500 hover:bg-blue-600 text-white bg-transparent font-semibold">Enviar mensaje</a>
                    <a class="cursor-pointer h-7 px-3 ml-3 focus:outline-none hover:border-transparent text-center rounded border border-gray-400 hover:bg-blue-500 hover:text-white bg-transparent text-gray-500 font-semibold">Editar perfil</a>
                    
                    <button class="flex items-center ml-3 border border-blue-600 hover:bg-blue-600 hover:text-white rounded outline-none focus:outline-none bg-transparent text-blue-600 text-sm py-1 px-2">
                        <span class="block">Seguir</span>
                        <svg class="block h-5 w-5 pl-1" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                            <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" />
                        </svg>
                    </button>
                    <a class="cursor-pointer ml-2 p-1 border-transparent text-gray-700 rounded-full hover:text-blue-600 focus:outline-none focus:text-gray-600"
                    aria-label="Notifications">
                        <svg class="h-8 w-8" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" stroke="currentColor" viewBox="0 0 24 24">
                            <path d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"/>
                            <path d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
                        </svg>
                    </a>
                </div>
                <ul class="flex justify-content-around items-center">
                    <li>
                        <span class="block text-base flex"><span class="font-bold mr-2">23 </span> Posts</span>
                    </li>
                    <li>
                        <span class="cursor-pointer block text-base flex ml-5"><span class="font-bold mr-2">102k </span> Followers</span>
                    </li>
                    <li>
                        <span class="cursor-pointer block text-base flex ml-5"><span class="font-bold mr-2">654 </span> followed</span>
                    </li>
                </ul>
                <br>
                <div class="">
                    <h1 class="text-base font-bold font-light">Darcy</h1>
                    <span class="text-base">I am Darcy, I like music, and record videos</span>
                    <a class="block text-base text-blue-500 mt-2" target="_blank">https://tailwindcomponents.com/</a>
                </div>
            </div>
    </div>
    <div class="border-b border-gray-300"></div>
    <article class="mt-5 grid grid-cols-3 gap-10">
        <div class="cursor-pointer relative" style="width:300px; height:300px">
            <img src="https://images.pexels.com/photos/247431/pexels-photo-247431.jpeg?auto=compress&cs=tinysrgb&h=750&w=1260"
                class="foto w-full h-full object-cover"
                alt="description" />
        </div>
        <div class="cursor-pointer relative" style="width:300px; height:300px">
            <img src="https://images.pexels.com/photos/258109/pexels-photo-258109.jpeg?auto=compress&cs=tinysrgb&h=750&w=1260"
                class="foto w-full h-full object-cover"
                alt="description" />
        </div>
        <div class="cursor-pointer relative" style="width:300px; height:300px">
            <img src="https://images.pexels.com/photos/248771/pexels-photo-248771.jpeg?auto=compress&cs=tinysrgb&h=750&w=1260"
                class="foto w-full h-full object-cover"
                alt="description" />
        </div>
    </article>
</div>

How to make a Example Profile with Tailwind CSS?

Install tailwind css of verion 2.0.3

Use the script html tag to import the script of Tailwind CSS of the version 2.0.3

<script src="https://cdn.tailwindcss.com"></script>

All the unility class needed to make a Example Profile component

  • w-11/12
  • flex
  • pb-10
  • h-40
  • w-40
  • ml-10
  • block
  • text-gray-700
  • text-3xl
  • h-7
  • px-3
  • ml-3
  • border-transparent
  • text-center
  • bg-blue-500
  • hover:bg-blue-600
  • text-white
  • bg-transparent
  • hover:border-transparent
  • border-gray-400
  • hover:bg-blue-500
  • hover:text-white
  • text-gray-500
  • border-blue-600
  • text-blue-600
  • text-sm
  • py-1
  • px-2
  • h-5
  • w-5
  • pl-1
  • ml-2
  • p-1
  • hover:text-blue-600
  • focus:text-gray-600
  • h-8
  • w-8
  • text-base
  • mr-2
  • ml-5
  • text-blue-500
  • mt-2
  • border-b
  • border-gray-300
  • mt-5
  • grid
  • grid-cols-3
  • gap-10
  • relative
  • w-full
  • h-full

51 steps to make a Example Profile component with Tailwind CSS

  1. Use w-11/12 to set an element to a fixed width(11/12).

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

  3. Control the padding on bottom side of an element to 2.5rem using the pb-10 utilities.

  4. Use h-40 to set an element to a fixed height(10rem).

  5. Use w-40 to set an element to a fixed width(10rem).

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

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

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

  9. Control the text color of an element to 3xl using the text-3xl utilities.

  10. Use h-7 to set an element to a fixed height(1.75rem).

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

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

  13. Control the border color of an element to transparent using the border-transparent utilities.

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

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

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

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

  18. Control the background color of an element to transparent using the bg-transparent utilities.

  19. Control the border color of an element to transparent using the hover:border-transparent utilities on hover.

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

  21. Control the background color of an element to blue-500 using the hover:bg-blue-500 utilities on hover.

  22. Control the text color of an element to white on hover using the hover:text-white utilities.

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

  24. Control the border color of an element to blue-600 using the border-blue-600 utilities.

  25. Control the text color of an element to blue-600 using the text-blue-600 utilities.

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

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

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

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

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

  31. Set the left padding of the element to 0.25rem using the pl-1 utilities class

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

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

  34. Control the text color of an element to blue-600 on hover using the hover:text-blue-600 utilities.

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

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

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

  38. Control the text color of an element to base using the text-base utilities.

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

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

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

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

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

  44. Control the border color of an element to gray-300 using the border-gray-300 utilities.

  45. Control the margin on top side of an element to 1.25rem using the mt-5 utilities.

  46. Use grid to create a grid container.

  47. Use grid to create a grid container.

  48. To specify the width between columns, you can use the gap-10 utilities.

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

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

  51. Use h-full to set an element’s height to 100% of its parent, as long as the parent has a defined height.

Conclusion

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