Timeline
The TkTimeline is a component that displays a vertical or horizontal timeline of events.
The TkTimelineItem is a helper component used to create customized content within the TkTimeline component.
- React
- Vue
- Angular
import { TkTimeline, TkTimelineItem } from '@takeoff-ui/react'
import { TkTimeline, TkTimelineItem } from '@takeoff-ui/vue'
import { TkTimeline, TkTimelineItem } from '@takeoff-ui/angular'
Basic
This demo visualizes the items to display on the timeline. Each object should have at least a title. description and date are optional.
- React
- Vue
- Angular
<TkTimeline items={items} />
<TkTimeline :items.prop="items" />
<tk-timeline [items]="items" />
Orientation
This example illustrates the orientation of the timeline.
- React
- Vue
- Angular
<TkTimeline items={items} />
<TkTimeline items={items} orientation="vertical" />
<TkTimeline :items.prop="items" />
<TkTimeline :items.prop="items" orientation="vertical" />
<tk-timeline [items]="items" />
<tk-timeline [items]="items" orientation="vertical" />
Alternate
This example illustrates whether to alternate the position of timeline items relative to the line.
- React
- Vue
- Angular
<TkTimeline items={items} />
<TkTimeline items={items} alternate={false} />
<TkTimeline items.prop="items" />
<TkTimeline :items.prop="items" :alternate="false"/>
<tk-timeline [items]="items" />
<tk-timeline [items]="items" [alternate]="false" />
Customization
TkTimelineItem is a helper component used to create customized content within the TkTimeline component. It's used to add HTML, images, buttons, or any custom content when the standard timeline item structure (title, description, date) isn't sufficient.
Custom Title
Custom description with HTML and Image.Another custom timeline item
Yet Another Item
This is yet another custom timeline item with more content.
Final Item
This is the final custom timeline item.
- React
- Vue
- Angular
<TkTimeline orientation="vertical">
<TkTimelineItem>
<div className="custom-content">
<h3 className="text-black-700">Custom Title</h3>
<p>
Custom description with <strong>HTML</strong>
</p>
<img
src="https://flagpedia.net/data/flags/h24/tr.webp"
alt="Custom image"
/>
</div>
</TkTimelineItem>
<TkTimeline />
<TkTimeline>
<TkTimelineItem>
<div class="custom-content">
<h3 class="text-black-700">Custom Title</h3>
<p>
Custom description with <strong>HTML</strong>
</p>
<img
src="https://flagpedia.net/data/flags/h24/tr.webp"
alt="Custom image"
/>
</div>
</TkTimelineItem>
</TkTimeline>
<tk-timeline>
<tk-timeline-item>
<div class="custom-content">
<h3 class="text-black-700">Custom Title</h3>
<p>
Custom description with <strong>HTML</strong>
</p>
<img
src="https://flagpedia.net/data/flags/h24/tr.webp"
alt="Custom image"
/>
</div>
</tk-timeline-item>
</tk-timeline>
API
Props
| Name | Type | Default | Description |
|---|---|---|---|
boolean | true | Whether to alternate the position of timeline items relative to the line. | |
TimelineItem[] | [] | An array of objects representing the items to display on the timeline. Each object should have at least a title. description and date are optional. | |
"horizontal", "vertical" | 'horizontal' | The orientation of the timeline. |
Interfaces
TimelineItem
interface TimelineItem {
title: string;
description?: string;
date?: string;
}