Flowbite 컴포넌트 — 타임라인(Timeline)
Flowbite의 타임라인(Timeline) 컴포넌트는 시간순으로 진행되는 이벤트나 단계를 시각적으로 보여줄 때 사용해요. 세로·가로 배치, 아이콘, 점(dot), 포인트 형태 등 다양한 스타일을 Tailwind CSS 클래스로 구성할 수 있어요.
출처: 문서
본문
기본 타임라인은 세로 방향으로 이벤트들을 나열하고, 왼쪽에 점과 세로 선으로 진행 흐름을 표시해요. 아래는 기본 세로 타임라인 예시예요.
<ol class="relative border-s border-gray-200 dark:border-gray-700">
<li class="mb-10 ms-4">
<div class="absolute w-3 h-3 bg-gray-200 rounded-full mt-1.5 -start-1.5 border border-white dark:border-gray-900 dark:bg-gray-700"></div>
<time class="mb-1 text-sm font-normal leading-none text-gray-400 dark:text-gray-500">February 2022</time>
<h3 class="text-lg font-semibold text-gray-900 dark:text-white">Application UI code in Tailwind CSS</h3>
<p class="mb-4 text-base font-normal text-gray-500 dark:text-gray-400">Get access to over 20+ pages including a dashboard layout, charts, kanban board, calendar, and pre-order E-commerce & Marketing pages.</p>
<a href="#" class="inline-flex items-center px-4 py-2 text-sm font-medium text-gray-900 bg-white border border-gray-200 rounded-lg hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:outline-none focus:ring-gray-100 focus:text-blue-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 dark:focus:ring-gray-700">Learn more</a>
</li>
</ol>
핵심 구조를 정리하면 다음과 같아요.
- 컨테이너
<ol>에relative border-s로 왼쪽 세로 선을 만들고요. - 각
<li>에ms-4로 여백을 주고,absolute점(dot)을-start-1.5위치에 배치해 세로 선 위에 얹어요. time,h3,p요소로 날짜·제목·내용을 담아 일관된 흐름을 만들어요.
아이콘이 있는 타임라인
점 대신 아이콘을 사용해 더 시각적으로 구분할 수도 있어요. 아이콘은 배경색 원 안에 SVG로 배치해요.
<ol class="relative border-s border-gray-200 dark:border-gray-700">
<li class="mb-10 ms-6">
<span class="absolute flex items-center justify-center w-6 h-6 bg-blue-100 rounded-full -start-3 ring-8 ring-white dark:ring-gray-900 dark:bg-blue-900">
<svg class="w-2.5 h-2.5 text-blue-800 dark:text-blue-300" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 20 20">
<path d="M20 4a2 2 0 0 0-2-2h-2V1a1 1 0 0 0-2 0v1h-3V1a1 1 0 0 0-2 0v1H6V1a1 1 0 0 0-2 0v1H2a2 2 0 0 0-2 2v2h20V4ZM0 18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8H0v10Zm5-8h10a1 1 0 0 1 0 2H5a1 1 0 0 1 0-2Z"/>
</svg>
</span>
<h3 class="mb-1 text-lg font-semibold text-gray-900 dark:text-white">Flowbite Library v1.2.2</h3>
<time class="block mb-2 text-sm font-normal leading-none text-gray-400 dark:text-gray-500">Released on December 2nd, 2021</time>
<p class="text-base font-normal text-gray-500 dark:text-gray-400">Get started with dozens of web components and interactive elements built on top of Tailwind CSS.</p>
</li>
</ol>
아이콘 원은 bg-blue-100 배경과 ring-8 ring-white(다크는 dark:ring-gray-900)로 선 위에 떠 있는 느낌을 줘요.
타임라인은 프로젝트 일정, 제품 출시 이력, 회사의 연혁, 단계별 진행 상황 등을 보여줄 때 유용해요. 가로 배치로 바꾸고 싶다면 flex와 방향 클래스를 조합하면 됩니다.