- Published on
6 Easy Ways To Create A Simple Vertical Timeline With Tailwind CSS

- What is Tailwind CSS?
- The description of Simple Vertical Timeline ui component
- Why use Tailwind CSS to make a Simple Vertical Timeline ui component?
- The preview of Simple Vertical Timeline ui component
- The source code of Simple Vertical Timeline ui component
- How to make a Simple Vertical Timeline with Tailwind CSS?
- Install tailwind css of verion 1.9.0
- All the unility class needed to make a Simple Vertical Timeline component
- 33 steps to make a Simple 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 Simple Vertical Timeline ui component
This is my simple example vertical timeline using flexbox, maybe help you to make another great timeline.
Why use Tailwind CSS to make a Simple Vertical Timeline ui component?
- It can make the building process of Simple Vertical Timeline ui component faster and more easily.
- Enables building complex responsive layouts and components freely.
- Minimum lines of CSS code in Simple Vertical Timeline component file.
The preview of Simple Vertical Timeline ui component
Free download of the Simple Vertical Timeline's source code
The source code of Simple Vertical Timeline ui component
<div class="container bg-gray-200 mx-auto w-full h-full">
<div class="relative wrap overflow-hidden p-10 h-full">
<div class="border-2-2 absolute border-opacity-20 border-gray-700 h-full border" style="left: 50%"></div>
<!-- right timeline -->
<div class="mb-8 flex justify-between items-center w-full right-timeline">
<div class="order-1 w-5/12"></div>
<div class="z-20 flex items-center order-1 bg-gray-800 shadow-xl w-8 h-8 rounded-full">
<h1 class="mx-auto font-semibold text-lg text-white">1</h1>
</div>
<div class="order-1 bg-gray-400 rounded-lg shadow-xl w-5/12 px-6 py-4">
<h3 class="mb-3 font-bold text-gray-800 text-xl">Lorem Ipsum</h3>
<p class="text-sm leading-snug tracking-wide text-gray-900 text-opacity-100">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
</div>
</div>
<!-- left timeline -->
<div class="mb-8 flex justify-between flex-row-reverse items-center w-full left-timeline">
<div class="order-1 w-5/12"></div>
<div class="z-20 flex items-center order-1 bg-gray-800 shadow-xl w-8 h-8 rounded-full">
<h1 class="mx-auto text-white font-semibold text-lg">2</h1>
</div>
<div class="order-1 bg-red-400 rounded-lg shadow-xl w-5/12 px-6 py-4">
<h3 class="mb-3 font-bold text-white text-xl">Lorem Ipsum</h3>
<p class="text-sm font-medium leading-snug tracking-wide text-white text-opacity-100">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
</div>
</div>
<!-- right timeline -->
<div class="mb-8 flex justify-between items-center w-full right-timeline">
<div class="order-1 w-5/12"></div>
<div class="z-20 flex items-center order-1 bg-gray-800 shadow-xl w-8 h-8 rounded-full">
<h1 class="mx-auto font-semibold text-lg text-white">3</h1>
</div>
<div class="order-1 bg-gray-400 rounded-lg shadow-xl w-5/12 px-6 py-4">
<h3 class="mb-3 font-bold text-gray-800 text-xl">Lorem Ipsum</h3>
<p class="text-sm leading-snug tracking-wide text-gray-900 text-opacity-100">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
</div>
</div>
<!-- left timeline -->
<div class="mb-8 flex justify-between flex-row-reverse items-center w-full left-timeline">
<div class="order-1 w-5/12"></div>
<div class="z-20 flex items-center order-1 bg-gray-800 shadow-xl w-8 h-8 rounded-full">
<h1 class="mx-auto text-white font-semibold text-lg">4</h1>
</div>
<div class="order-1 bg-red-400 rounded-lg shadow-xl w-5/12 px-6 py-4">
<h3 class="mb-3 font-bold text-white text-xl">Lorem Ipsum</h3>
<p class="text-sm font-medium leading-snug tracking-wide text-white text-opacity-100">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.</p>
</div>
</div>
</div>
</div>
How to make a Simple Vertical Timeline with Tailwind CSS?
Install tailwind css of verion 1.9.0
Use the link
html tag to import the stylesheet of Tailwind CSS of the version 1.9.0
<link href=https://unpkg.com/[email protected]/dist/tailwind.min.css rel="stylesheet">
All the unility class needed to make a Simple Vertical Timeline component
bg-gray-200
mx-auto
w-full
h-full
relative
overflow-hidden
p-10
border-2-2
absolute
border-opacity-20
border-gray-700
mb-8
flex
right-timeline
w-5/12
z-20
bg-gray-800
w-8
h-8
text-lg
text-white
bg-gray-400
px-6
py-4
mb-3
text-gray-800
text-xl
text-sm
text-gray-900
text-opacity-100
flex-row-reverse
left-timeline
bg-red-400
33 steps to make a Simple Vertical Timeline component with Tailwind CSS
Control the background color of an element to gray-200 using the
bg-gray-200
utilities.Control the horizontal margin of an element to auto using the
mx-auto
utilities.Use
w-full
to set an element to a 100% based width.Use
h-full
to set an element’s height to 100% of its parent, as long as the parent has a defined height.Use
relative
to position an element according to the normal flow of the document.Use
overflow-hidden
to clip any content within an element that overflows the bounds of that element.Control the padding on all sides of an element to 2.5rem using the
p-10
utilities.Control the border color of an element to 2-2 using the
border-2-2
utilities.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.Control the border color of an element to opacity-20 using the
border-opacity-20
utilities.Control the border color of an element to gray-700 using the
border-gray-700
utilities.Control the margin on bottom side of an element to 2rem using the
mb-8
utilities.Use
flex
to create a block-level flex container.Use the
right-timeline
utilities to set the right position of a positioned element to timeline.Use
w-5/12
to set an element to a fixed width(5/12).Control the stack order (or three-dimensional positioning) of an element to 20 in Tailwind, regardless of order it has been displayed, using the
z-20
utilities.Control the background color of an element to gray-800 using the
bg-gray-800
utilities.Use
w-8
to set an element to a fixed width(2rem).Use
h-8
to set an element to a fixed height(2rem).Control the text color of an element to lg using the
text-lg
utilities.Control the text color of an element to white using the
text-white
utilities.Control the background color of an element to gray-400 using the
bg-gray-400
utilities.Control the horizontal padding of an element to 1.5rem using the
px-6
utilities.Control the vertical padding of an element to 1rem using the
py-4
utilities.Control the margin on bottom side of an element to 0.75rem using the
mb-3
utilities.Control the text color of an element to gray-800 using the
text-gray-800
utilities.Control the text color of an element to xl using the
text-xl
utilities.Control the text color of an element to sm using the
text-sm
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 opacity-100 using the
text-opacity-100
utilities.Use
flex
to create a block-level flex container.Use the
left-timeline
utilities to set the left position of a positioned element to timeline.Control the background color of an element to red-400 using the
bg-red-400
utilities.
Conclusion
The above is a step-by-step tutorial on how to use Tailwind CSS to make a Simple Vertical Timeline components, learn and follow along to implement your own components.