Skip to content

Timeline ​

Activity feed: dated events with title, author, time, description and icon, grouped by day ("Today", "Yesterday", then the full date).

Usage ​

Grouped by day ​

vue
<script setup>
import { ChatBubbleLeftIcon, CheckIcon } from '@heroicons/vue/24/outline'

const items = [
  { id: 1, title: 'Comment on "Mockups v2"', author: 'Camille Martin', date: '2026-11-27T10:42:00', icon: ChatBubbleLeftIcon },
  { id: 2, title: 'Task completed', author: 'Leo Dubois', date: '2026-11-27T09:05:00', icon: CheckIcon, variant: 'success' }
]
</script>

<template>
  <SuTimeline :items="items" />
</template>

Events show in the order of items: sort them first (usually newest first). Day titles are h3 by default (heading-level).

Without grouping ​

vue
<SuTimeline :items="items" :group-by-day="false" />

Each event then shows its date and time.

Custom content ​

vue
<SuTimeline :items="items">
  <template #item="{ item, time, datetime }">
    <p><strong>{{ item.author }}</strong> {{ item.title }}</p>
    <time :datetime="datetime">{{ time }}</time>
  </template>
</SuTimeline>

API ​

Props ​

PropTypeDefaultDescription
itemsTimelineItem[]-Events
groupByDaybooleantrueGroups by day, under a title
headingLevel2 | 3 | 4 | 5 | 63Day title level
nowDate | string | numbernowReference date for "today" and "yesterday"

TimelineItem ​

PropertyTypeDescription
idstring | numberRender key
titlestringTitle
dateDate | string | numberDate and time
authorstringAuthor
descriptionstringText below the title
iconComponentMarker icon
variant'default' | 'primary' | 'success' | 'warning' | 'error'Marker color

Slots ​

SlotPropsDescription
item{ item, time, datetime }Event content

Accessibility ​

  • Each day is a title followed by an ordered list it names (aria-labelledby).
  • Dates are <time datetime> in ISO format; days and times are formatted in the current language (Intl).
  • Markers and icons are decorative: a variant color does not replace the event text.
  • Server rendering: pass now so that "today" is the same on the server and in the browser.

Publié sous licence MIT.