So I have the design I want to make. Basically it's a timeline that goes from the bottom left corner to the top right corner of the page. Additionally, I need to place some div elements between the rows.
I also want it to be responsive, specifically the length of it will be reduced, but I still want the lines to protrude upwards.
Any suggestions on how to achieve this using ReactJS and TailwindCSS?
The examples I found on the internet are online horizontal and vertical timeline styles. There are no examples of bending timelines
I created a timeline similar to the image you provided, using mostly
grid
.In the example I created, there are 3 custom utilities一个>:
main.css:
borderGray
Class creates gray borders at the top and bottom of the element and centers the text.textClass
is responsible forfont-size
responsiveness. This class can be completely changed. It looks very convenient here.slantedLine
Class creates a diagonal line through the element from the lower left corner to the upper right corner. This is the answer I used to get: Drawing diagonal lines in div background CSSNow, go to
HTML
.I created three different variations that can be changed from one to another based on screen size, in case you want to use multiple variations in your responsive design. These variations are as follows:
This is what it looks like under the hood:
HTML:
Tailwind Play
illustrate:
There are three differences between these variants:
col-span-{n}
for each text container. documentgrid-cols-{n}
andgrid-rows-{n}
. Docs-1 Docs-2and
row-start-{n}for each element within
grid
. Docs-1Each odd numbered element is just a text area. We insert a paragraph into these divs to display the required text/links:
Each even-numbered element is a region of diagonal type (
slantedLine
). The diagonal line goes from the lower left corner to the upper right corner. When we put two elements with such lines together, we get the effect of top and bottom diagonal borders:Together:
It may not give you the exact design you are looking for, but it can give you an idea of how to move forward from here.
If you have questions, please let me know. I hope it helps.