- Published on
A Complete Guide To Build A Responsive vertical timeline With Tailwind CSS

- What is Tailwind CSS?
- The description of Responsive vertical timeline ui component
- Why use Tailwind CSS to make a Responsive vertical timeline ui component?
- The preview of Responsive vertical timeline ui component
- The source code of Responsive vertical timeline ui component
- How to make a Responsive vertical timeline with Tailwind CSS?
- Install tailwind css of verion 2.0.2
- All the unility class needed to make a Responsive vertical timeline component
- 28 steps to make a Responsive vertical timeline 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 Responsive vertical timeline ui component
A responsive timeline created using css grid and flexbox.
Why use Tailwind CSS to make a Responsive vertical timeline ui component?
- It can make the building process of Responsive vertical timeline ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Responsive vertical timeline component file.
The preview of Responsive vertical timeline ui component
Free download of the Responsive vertical timeline's source code
The source code of Responsive vertical timeline ui component
<div class="container">
<div
class="flex flex-col md:grid grid-cols-9 mx-auto p-2 text-blue-50"
>
<!-- left -->
<div class="flex flex-row-reverse md:contents">
<div
class="bg-blue-500 col-start-1 col-end-5 p-4 rounded-xl my-4 ml-auto shadow-md"
>
<h3 class="font-semibold text-lg mb-1">Lorem ipsum</h3>
<p class="leading-tight text-justify">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Modi,
quaerat?
</p>
</div>
<div class="col-start-5 col-end-6 md:mx-auto relative mr-10">
<div class="h-full w-6 flex items-center justify-center">
<div class="h-full w-1 bg-blue-800 pointer-events-none"></div>
</div>
<div
class="w-6 h-6 absolute top-1/2 -mt-3 rounded-full bg-blue-500 shadow"
></div>
</div>
</div>
<!-- right -->
<div class="flex md:contents">
<div class="col-start-5 col-end-6 mr-10 md:mx-auto relative">
<div class="h-full w-6 flex items-center justify-center">
<div class="h-full w-1 bg-blue-800 pointer-events-none"></div>
</div>
<div
class="w-6 h-6 absolute top-1/2 -mt-3 rounded-full bg-blue-500 shadow"
></div>
</div>
<div
class="bg-blue-500 col-start-6 col-end-10 p-4 rounded-xl my-4 mr-auto shadow-md"
>
<h3 class="font-semibold text-lg mb-1">Lorem ipsum</h3>
<p class="leading-tight text-justify">
Lorem ipsum, dolor sit amet consectetur adipisicing elit.
Vitae, facilis.
</p>
</div>
</div>
<!-- left -->
<div class="flex flex-row-reverse md:contents">
<div
class="bg-blue-500 col-start-1 col-end-5 p-4 rounded-xl my-4 ml-auto shadow-md"
>
<h3 class="font-semibold text-lg mb-1">Lorem ipsum</h3>
<p class="leading-tight text-justify">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Modi,
quaerat?
</p>
</div>
<div class="col-start-5 col-end-6 md:mx-auto relative mr-10">
<div class="h-full w-6 flex items-center justify-center">
<div class="h-full w-1 bg-blue-800 pointer-events-none"></div>
</div>
<div
class="w-6 h-6 absolute top-1/2 -mt-3 rounded-full bg-blue-500 shadow"
></div>
</div>
</div>
<!-- left -->
<div class="flex flex-row-reverse md:contents">
<div
class="bg-blue-500 col-start-1 col-end-5 p-4 rounded-xl my-4 ml-auto shadow-md"
>
<h3 class="font-semibold text-lg mb-1">Lorem ipsum</h3>
<p class="leading-tight text-justify">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Modi,
quaerat?
</p>
</div>
<div class="col-start-5 col-end-6 md:mx-auto relative mr-10">
<div class="h-full w-6 flex items-center justify-center">
<div class="h-full w-1 bg-blue-800 pointer-events-none"></div>
</div>
<div
class="w-6 h-6 absolute top-1/2 -mt-3 rounded-full bg-blue-500 shadow"
></div>
</div>
</div>
<!-- right -->
<div class="flex md:contents">
<div class="col-start-5 col-end-6 mr-10 md:mx-auto relative">
<div class="h-full w-6 flex items-center justify-center">
<div class="h-full w-1 bg-blue-800 pointer-events-none"></div>
</div>
<div
class="w-6 h-6 absolute top-1/2 -mt-3 rounded-full bg-blue-500 shadow"
></div>
</div>
<div
class="bg-blue-500 col-start-6 col-end-10 p-4 rounded-xl my-4 mr-auto shadow-md"
>
<h3 class="font-semibold text-lg mb-1">Lorem ipsum</h3>
<p class="leading-tight text-justify">
Lorem ipsum, dolor sit amet consectetur adipisicing elit.
Vitae, facilis.
</p>
</div>
</div>
</div>
</div>
How to make a Responsive vertical timeline 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 make a Responsive vertical timeline component
flex
flex-col
md:grid
grid-cols-9
mx-auto
p-2
text-blue-50
flex-row-reverse
md:contents
bg-blue-500
p-4
my-4
ml-auto
text-lg
mb-1
text-justify
md:mx-auto
relative
mr-10
h-full
w-6
w-1
bg-blue-800
h-6
absolute
top-1/2
-mt-3
mr-auto
28 steps to make a Responsive vertical timeline component with Tailwind CSS
Use
flex
to create a block-level flex container.Use
flex
to create a block-level flex container.Use
grid
to create a grid container at only medium screen sizes.Use
grid
to create a grid container.Control the horizontal margin of an element to auto using the
mx-auto
utilities.Control the padding on all sides of an element to 0.5rem using the
p-2
utilities.Control the text color of an element to blue-50 using the
text-blue-50
utilities.Use
flex
to create a block-level flex container.Use
contents
to create a “phantom” container whose children act like direct children of the parert at only medium screen sizes.Control the background color of an element to blue-500 using the
bg-blue-500
utilities.Control the padding on all sides of an element to 1rem using the
p-4
utilities.Control the vertical margin of an element to 1rem using the
my-4
utilities.Control the margin on left side of an element to auto using the
ml-auto
utilities.Control the text color of an element to lg using the
text-lg
utilities.Control the margin on bottom side of an element to 0.25rem using the
mb-1
utilities.Control the text color of an element to justify using the
text-justify
utilities.Control the horizontal margin of an element to auto at only medium screen sizes using the
md:mx-auto
utilities.Use
relative
to position an element according to the normal flow of the document.Control the margin on right side of an element to 2.5rem using the
mr-10
utilities.Use
h-full
to set an element’s height to 100% of its parent, as long as the parent has a defined height.Use
w-6
to set an element to a fixed width(1.5rem).Use
w-1
to set an element to a fixed width(0.25rem).Control the background color of an element to blue-800 using the
bg-blue-800
utilities.Use
h-6
to set an element to a fixed height(1.5rem).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.Use the
top-1/2
utilities to set the top position of a positioned element to 1/2.Control the margin on top side of an element to -0.75rem using the
-mt-3
utilities.Control the margin on right side of an element to auto using the
mr-auto
utilities.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to make a Responsive vertical timeline components, learn and follow along to implement your own components.