- Published on
How to Make A Twitter - Following Recommendation With Tailwind CSS?

- What is Tailwind CSS?
- The description of Twitter - Following Recommendation ui component
- Why use Tailwind CSS to create a Twitter - Following Recommendation ui component?
- The preview of Twitter - Following Recommendation ui component
- The source code of Twitter - Following Recommendation ui component
- How to create a Twitter - Following Recommendation with Tailwind CSS?
- Install tailwind css of verion 3.0.18
- All the unility class needed to create a Twitter - Following Recommendation component
- 24 steps to create a Twitter - Following Recommendation 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 Twitter - Following Recommendation ui component
Twitter following recommendation
Why use Tailwind CSS to create a Twitter - Following Recommendation ui component?
- It can make the building process of Twitter - Following Recommendation ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Twitter - Following Recommendation component file.
The preview of Twitter - Following Recommendation ui component
Free download of the Twitter - Following Recommendation's source code
The source code of Twitter - Following Recommendation ui component
<div class="bg-black h-screen items-center justify-center flex">
<card class="bg-gray-900 text-gray-200 w-96 rounded-lg">
<header class="font-bold text-2xl px-5 py-4">
Who to follow
</header>
<main class="px-5">
<content class="grid grid-cols-6">
<div class="">
<img src="https://picsum.photos/200/200" class="h-14 w-14 rounded-full" />
</div>
<div class="col-span-3 px-3 font-semibold flex flex-col">
<div class=""> Sandy Budiman </div>
<div class="text-sm text-gray-400 font-light"> @sandyversion </div>
</div>
<div class="col-span-2 py-2 justify-self-end">
<button class="bg-gray-200 text-gray-900 font-bold text-md rounded-full py-1 px-4">
Follow
</button>
</div>
</content>
</main>
<footer class="px-5 py-4 text-blue-600">
Show more
</footer>
</card>
</div>
How to create a Twitter - Following Recommendation with Tailwind CSS?
Install tailwind css of verion 3.0.18
Use the script
html tag to import the script of Tailwind CSS of the version 3.0.18
<script src="https://cdn.tailwindcss.com"></script>
All the unility class needed to create a Twitter - Following Recommendation component
bg-black
h-screen
flex
bg-gray-900
text-gray-200
w-96
text-2xl
px-5
py-4
grid
grid-cols-6
h-14
w-14
px-3
flex-col
text-sm
text-gray-400
py-2
bg-gray-200
text-gray-900
text-md
py-1
px-4
text-blue-600
24 steps to create a Twitter - Following Recommendation component with Tailwind CSS
Control the background color of an element to black using the
bg-black
utilities.Use
h-screen
to make an element span the entire height of the viewport.Use
flex
to create a block-level flex container.Control the background color of an element to gray-900 using the
bg-gray-900
utilities.Control the text color of an element to gray-200 using the
text-gray-200
utilities.Use
w-96
to set an element to a fixed width(24rem).Control the text color of an element to 2xl using the
text-2xl
utilities.Control the horizontal padding of an element to 1.25rem using the
px-5
utilities.Control the vertical padding of an element to 1rem using the
py-4
utilities.Use
grid
to create a grid container.Use
grid
to create a grid container.Use
h-14
to set an element to a fixed height(3.5rem).Use
w-14
to set an element to a fixed width(3.5rem).Control the horizontal padding of an element to 0.75rem using the
px-3
utilities.Use
flex
to create a block-level flex container.Control the text color of an element to sm using the
text-sm
utilities.Control the text color of an element to gray-400 using the
text-gray-400
utilities.Control the vertical padding of an element to 0.5rem using the
py-2
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-900 using the
text-gray-900
utilities.Control the text color of an element to md using the
text-md
utilities.Control the vertical padding of an element to 0.25rem using the
py-1
utilities.Control the horizontal padding of an element to 1rem using the
px-4
utilities.Control the text color of an element to blue-600 using the
text-blue-600
utilities.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to create a Twitter - Following Recommendation components, learn and follow along to implement your own components.