Timeline
Visually display timeline.
Basic usage
Timeline can be split into multiple activities. Timestamps are important features that distinguish them from other components. Note the difference with Steps.
<template>
<b-timeline>
<b-timeline-item
v-for="(activity, index) in activities"
:key="index"
:timestamp="activity.timestamp"
>
{{ activity.content }}
</b-timeline-item>
</b-timeline>
</template>
<script lang="ts" setup>
const activities = [
{
content: 'Event start',
timestamp: '2018-04-15',
},
{
content: 'Approved',
timestamp: '2018-04-13',
},
{
content: 'Success',
timestamp: '2018-04-11',
},
]
</script>
Custom node
Size, color, and icons can be customized in node.
Custom icon
2018-04-12 20:46
Custom color
2018-04-03 20:46
Custom size
2018-04-03 20:46
Custom hollow
2018-04-03 20:46
Default node
2018-04-03 20:46
<template>
<b-timeline>
<b-timeline-item
v-for="(activity, index) in activities"
:key="index"
:icon="activity.icon"
:type="activity.type"
:color="activity.color"
:size="activity.size"
:hollow="activity.hollow"
:timestamp="activity.timestamp"
>
{{ activity.content }}
</b-timeline-item>
</b-timeline>
</template>
<script lang="ts" setup>
import { MoreHorizontal } from '@bigin/icons-vue'
const activities = [
{
content: 'Custom icon',
timestamp: '2018-04-12 20:46',
size: 'large',
type: 'primary',
icon: MoreHorizontal,
},
{
content: 'Custom color',
timestamp: '2018-04-03 20:46',
color: '#0bbd87',
},
{
content: 'Custom size',
timestamp: '2018-04-03 20:46',
size: 'large',
},
{
content: 'Custom hollow',
timestamp: '2018-04-03 20:46',
type: 'primary',
hollow: true,
},
{
content: 'Default node',
timestamp: '2018-04-03 20:46',
},
]
</script>
Custom timestamp
Timestamp can be placed on top of content when content is too high.
2018/4/12
Update Github template
Tom committed 2018/4/12 20:46
2018/4/3
Update Github template
Tom committed 2018/4/3 20:46
2018/4/2
Update Github template
Tom committed 2018/4/2 20:46
<template>
<b-timeline>
<b-timeline-item timestamp="2018/4/12" placement="top">
<b-card bordered body-class="p-4">
<h4>Update Github template</h4>
<p class="mt-2">Tom committed 2018/4/12 20:46</p>
</b-card>
</b-timeline-item>
<b-timeline-item timestamp="2018/4/3" placement="top">
<b-card bordered body-class="p-4">
<h4>Update Github template</h4>
<p class="mt-2">Tom committed 2018/4/3 20:46</p>
</b-card>
</b-timeline-item>
<b-timeline-item timestamp="2018/4/2" placement="top">
<b-card bordered body-class="p-4">
<h4>Update Github template</h4>
<p class="mt-2">Tom committed 2018/4/2 20:46</p>
</b-card>
</b-timeline-item>
</b-timeline>
</template>
Vertically centered
Timeline-Item is centered vertically.
2018/4/12
Update Github template
Tom committed 2018/4/12 20:46
2018/4/3
Update Github template
Tom committed 2018/4/3 20:46
<template>
<b-timeline>
<b-timeline-item center timestamp="2018/4/12" placement="top">
<b-card bordered body-class="p-4">
<h4>Update Github template</h4>
<p class="mt-2">Tom committed 2018/4/12 20:46</p>
</b-card>
</b-timeline-item>
<b-timeline-item timestamp="2018/4/3" placement="top">
<b-card bordered body-class="p-4">
<h4>Update Github template</h4>
<p class="mt-2">Tom committed 2018/4/3 20:46</p>
</b-card>
</b-timeline-item>
<b-timeline-item center timestamp="2018/4/2" placement="top">
Event start
</b-timeline-item>
<b-timeline-item timestamp="2018/4/2" placement="top">
Event end
</b-timeline-item>
</b-timeline>
</template>
Timeline Slots
Name | Description | Subtags |
---|
— | Custom content for timeline | Timeline-Item |
Timeline-Item Attributes
Name | Description | Type | Accepted Values | Default |
---|
timestamp | timestamp content | string | — | — |
hide-timestamp | whether to show timestamp | boolean | — | false |
center | Whether vertically centered | boolean | — | false |
placement | position of timestamp | string | top / bottom | bottom |
type | node type | string | primary / success / warning / danger / info | — |
color | background color of node | string | hsl / hsv / hex / rgb | — |
size | node size | string | normal / large | normal |
icon | icon component | string | Component | — | — |
hollow | icon is hollow | boolean | — | false |
Timeline-Item Slots
Name | Description |
---|
— | Custom content for timeline item |
dot | Custom defined node |