Timeline
Introduction
Section titled “Introduction”Shows an activity or event history. Each item has a time (an exact Instant, or a PlainDate for all-day items), a title, an optional description, an icon or avatar, a status tone shown by the marker icon and a status word, and optional action buttons. Timelines are vertical or horizontal, with items on one side or alternating, grouped by day in the configured timezone (“Today”, “Yesterday”, weekday names, dates; holidays and non-working days named from a business calendar). Times are absolute or relative. Older items collapse behind “Show N older”, and a host-supplied loadMore fetches more with loading, error, and retry states.
- Grouped by dayToday, Yesterday, weekdays, and dates in your timezone; holidays and non-working days named from a business calendar.
- Status you can readEvery tone has its own marker icon and a status word, so nothing depends on color.
- Three layoutsVertical, alternating sides, or a horizontal milestone strip that scrolls with the keyboard.
- Older on demandCollapse older items behind "Show N older" or load them from your server with loading, error, and retry.
- Actions per itemButtons grouped and named by the item, reachable with Tab, reported as aui-action.
Use it for
- Activity history of a record: document changes, approvals, employee profile events.
- Order or case tracking with a status per step in time.
- A horizontal milestone overview, such as a project or onboarding plan.
Use something else for
- Step-by-step task flows the user moves through: use Stepper.
- Scheduling or durations on a time axis: use Gantt or Scheduler.
- Chat conversations: use Chat.
Anatomy
<div class="aui-timeline aui-timeline--vertical aui-timeline--grouped"> <div class="aui-timeline__scroller"> (role="region" tabindex="0" when horizontal) <ol class="aui-timeline__list" aria-label="Document activity"> <li class="aui-timeline__group"> <h3 class="aui-timeline__day" id="...">Today</h3> <ol class="aui-timeline__items" aria-labelledby="..."> <li class="aui-timeline__item aui-timeline__item--success"> <span class="aui-timeline__marker" aria-hidden="true"><svg class="aui-icon">...</svg></span> <div class="aui-timeline__content"> <div class="aui-timeline__header"> <a class="aui-timeline__title" href="/docs/42">Policy approved</a> <span class="aui-timeline__status">Success</span> <time class="aui-timeline__time" datetime="2026-11-23T14:05:00.000Z" title="Monday, 23 November 2026 at 14:05">14:05</time> </div> <p class="aui-timeline__description">Approved by Ada Lovelace.</p> <div class="aui-timeline__actions" role="group" aria-label="Policy approved"><button class="aui-button">Open</button></div> </div> </li> </ol> </li> </ol> </div> <p class="aui-timeline__empty" hidden>No activity yet.</p> <div class="aui-timeline__footer"> <button class="aui-button aui-timeline__toggle" aria-expanded="false" aria-controls="...">Show 12 older</button> <button class="aui-button aui-timeline__load">Load older</button> </div></div>Live example
Section titled “Live example”Use the bar above each frame to switch theme, density, direction, and locale.
Timeline in the Document center showcase
Section titled “Timeline in the Document center showcase”The part of the Document center showcase that uses Timeline. Change its options, use it with the keyboard, and watch the event log; the link in the frame opens the full showcase. The bar above the frame switches theme, density, direction, and locale.
Showcase source
// Documents showcase: a document center over a simulated provider. The File Manager// browses folders (list or grid, sort, multi-select, rename, new folder, delete, move by drag or// cut and paste, uploads with progress); opening a photo shows it in the Image Viewer (zoom,// rotate, crop to a Blob); opening a text or code file shows it in the Code Viewer with a diff// against its previous version; every change is added to the Timeline of document activity; and// a Tour walks through the page.import { instant, type Instant } from '@absoluteui/core';import { CodeViewer, type CodeLanguage } from '@absoluteui/components/code-viewer';import { FileManager, type FileEntry, type FileManagerCreateFolderDetail, type FileManagerDeleteDetail, type FileManagerErrorDetail, type FileManagerMoveDetail, type FileManagerOpenDetail, type FileManagerProvider, type FileManagerRenameDetail, type FileManagerUploadDetail,} from '@absoluteui/components/file-manager';import { ImageViewer, type ImageViewerImage } from '@absoluteui/components/image-viewer';import { Timeline, type TimelineActionDetail, type TimelineItem, type TimelineTone } from '@absoluteui/components/timeline';import { Tour } from '@absoluteui/components/tour';import { action, choice, createShowcase, hostIn, section, status, toggle, wait } from './kit.js';
const sc = createShowcase({ title: 'Document center', description: 'Browse company documents, preview photos and files, compare versions, follow the activity, and take the guided tour.', simulated: true,});
// Simulated storage: entries, text contents with a previous version, and generated photos.const HOUR = 3_600_000;const now = Date.now();const ago = (hours: number): Instant => instant(now - hours * HOUR);
function photo(color: string, label: string): string { const canvas = document.createElement('canvas'); canvas.width = 640; canvas.height = 400; const ctx = canvas.getContext('2d'); if (ctx) { ctx.fillStyle = color; ctx.fillRect(0, 0, 640, 400); ctx.fillStyle = '#f8fafc'; ctx.beginPath(); ctx.arc(320, 170, 80, 0, Math.PI * 2); ctx.fill(); ctx.fillRect(190, 270, 260, 90); ctx.fillStyle = '#0f172a'; ctx.font = '600 28px sans-serif'; ctx.textAlign = 'center'; ctx.fillText(label, 320, 325); } return canvas.toDataURL('image/png');}
interface Stored { entry: FileEntry; text?: string; previous?: string; url?: string;}
const store = new Map<string, Stored>();let nextId = 1;function put(entry: Omit<FileEntry, 'id'> & { id?: string }, extra: Omit<Stored, 'entry'> = {}): FileEntry { const id = entry.id ?? `f${String(nextId++)}`; const full: FileEntry = { ...entry, id }; store.set(id, { entry: full, ...extra }); return full;}
const policyBefore = '{\n "policy": "Annual leave",\n "annualDays": 25,\n "carryOverDays": 5,\n "approval": "manager"\n}\n';const policyAfter = '{\n "policy": "Annual leave",\n "annualDays": 26,\n "carryOverDays": 5,\n "halfDays": true,\n "approval": ["manager", "hr"]\n}\n';const exportBefore = "export async function exportEmployees(limit = 100): Promise<string> {\n const response = await fetch(`/api/employees?limit=${String(limit)}`);\n return JSON.stringify(await response.json());\n}\n";const exportAfter = "/** Export employees as indented JSON; business days only (see the payroll calendar). */\nexport async function exportEmployees(limit = 100, signal?: AbortSignal): Promise<string> {\n const response = await fetch(`/api/employees?limit=${String(limit)}`, { signal });\n if (!response.ok) throw new Error(`Export failed: ${String(response.status)}`);\n return JSON.stringify(await response.json(), null, 2);\n}\n";const handbook = '# Employee handbook\n\nWelcome to the company. Read the **leave policy** first.\n\n## Working hours\n\n- Core hours: 10:00 to 16:00\n- Public holidays follow the `business calendar`\n';const handbookBefore = '# Employee handbook\n\nWelcome to the company.\n\n## Working hours\n\n- Core hours: 10:00 to 15:00\n';
put({ id: 'policies', name: 'Policies', kind: 'folder', parentId: null, hasChildren: true, modified: ago(30) });put({ id: 'photos', name: 'Badge photos', kind: 'folder', parentId: null, hasChildren: false, modified: ago(50) });put({ id: 'scripts', name: 'Scripts', kind: 'folder', parentId: null, hasChildren: false, modified: ago(70) });put({ id: 'archive', name: 'Archive', kind: 'folder', parentId: null, hasChildren: false, modified: ago(900) });put({ name: 'Employee handbook.md', kind: 'file', parentId: null, size: 18_240, mimeType: 'text/markdown', modified: ago(5) }, { text: handbook, previous: handbookBefore });put({ id: 'leave-policy', name: 'leave-policy.json', kind: 'file', parentId: 'policies', size: 1_204, mimeType: 'application/json', modified: ago(2) }, { text: policyAfter, previous: policyBefore });put({ name: 'travel-policy.md', kind: 'file', parentId: 'policies', size: 9_870, mimeType: 'text/markdown', modified: ago(120) }, { text: '# Travel policy\n\nBook economy for flights under six hours.\n' });put({ id: 'remote', name: 'Remote work', kind: 'folder', parentId: 'policies', hasChildren: false, modified: ago(200) });put({ name: 'export-employees.ts', kind: 'file', parentId: 'scripts', size: 2_310, mimeType: 'text/typescript', modified: ago(26) }, { text: exportAfter, previous: exportBefore });put({ name: 'monthly-report.sql', kind: 'file', parentId: 'scripts', size: 640, mimeType: 'application/sql', modified: ago(300) }, { text: "SELECT department, COUNT(*) AS headcount\nFROM employees\nWHERE status = 'active'\nGROUP BY department\nORDER BY headcount DESC;\n" });const PEOPLE: readonly [string, string][] = [ ['Ada Lovelace', '#1d4ed8'], ['Grace Hopper', '#15803d'], ['Alan Turing', '#b45309'], ['Katherine Johnson', '#7c3aed'],];for (const [index, [person, color]] of PEOPLE.entries()) { put({ name: `${person}.png`, kind: 'file', parentId: 'photos', size: 48_000 + index * 3_100, mimeType: 'image/png', modified: ago(48 + index) }, { url: photo(color, person) });}
const children = (parentId: string | null): FileEntry[] => [...store.values()].map((s) => s.entry).filter((e) => e.parentId === parentId);const latency = (): number => 180 + Math.round(Math.random() * 220);function stored(id: string): Stored { const s = store.get(id); if (!s) throw new Error('The file no longer exists.'); return s;}function withChildren(id: string | null): void { if (id === null) return; const s = store.get(id); if (s) s.entry = { ...s.entry, hasChildren: children(id).some((e) => e.kind === 'folder') };}
const provider: FileManagerProvider = { async list(folderId, { signal }) { await wait(latency(), signal); return children(folderId); }, async createFolder(parentId, name, { signal }) { await wait(latency(), signal); const entry = put({ name, kind: 'folder', parentId, hasChildren: false, modified: instant(Date.now()) }); withChildren(parentId); return entry; }, async rename(entry, name, { signal }) { await wait(latency(), signal); const s = stored(entry.id); s.entry = { ...s.entry, name, modified: instant(Date.now()) }; return s.entry; }, async move(entries, targetFolderId, { signal }) { await wait(latency(), signal); const sources = new Set(entries.map((e) => e.parentId)); const moved = entries.map((e) => { const s = stored(e.id); s.entry = { ...s.entry, parentId: targetFolderId }; return s.entry; }); for (const id of [...sources, targetFolderId]) withChildren(id); return moved; }, async delete(entries, { signal }) { await wait(latency(), signal); const remove = (id: string): void => { for (const child of children(id)) remove(child.id); store.delete(id); }; for (const e of entries) remove(e.id); for (const e of entries) withChildren(e.parentId); }, async upload(folderId, file, { signal, onProgress }) { // Simulated transfer: ten steps; names starting with "fail" are rejected by the "server". for (let step = 1; step <= 10; step++) { await wait(120, signal); onProgress(Math.round((file.size * step) / 10), file.size); } if (file.name.toLowerCase().startsWith('fail')) throw new Error('The server rejected the file.'); const text = /\.(?:ts|js|json|md|txt|sql|css|html|sh)$/i.test(file.name) ? await file.text() : undefined; return put({ name: file.name, kind: 'file', parentId: folderId, size: file.size, mimeType: file.type, modified: instant(Date.now()) }, text === undefined ? {} : { text }); }, async getUrl(entry, { signal }) { await wait(120, signal); const url = stored(entry.id).url; if (url === undefined) throw new Error('This file has no preview.'); return url; }, async read(entry, { signal }) { await wait(120, signal); return stored(entry.id).text ?? ''; },};
// Activity timeline: seeded history plus live entries from the File Manager.const activity: TimelineItem[] = [ { id: 'a1', title: 'Leave policy updated', description: '26 annual days, half days allowed, HR approval added.', tone: 'success', status: 'Published', time: ago(2), avatar: { name: 'Grace Hopper' }, actions: [{ id: 'compare', label: 'Compare versions' }] }, { id: 'a2', title: 'Handbook edited', description: 'Core hours extended to 16:00.', tone: 'info', time: ago(5), avatar: { name: 'Ada Lovelace' }, actions: [{ id: 'compare', label: 'Compare versions' }] }, { id: 'a3', title: 'Export script reviewed', tone: 'neutral', time: ago(26), avatar: { name: 'Alan Turing' } }, { id: 'a4', title: 'Badge photos uploaded', description: 'Four photos for new starters.', tone: 'success', time: ago(48), avatar: { name: 'Katherine Johnson' } }, { id: 'a5', title: 'Virus scan blocked an upload', description: 'invoice.pdf.exe was quarantined.', tone: 'error', status: 'Blocked', time: ago(52) },];let olderPages = 2;let activityId = 100;
// Layout: files, then the two previews, then activity.const filesSection = section(sc, 'Files', ['file-manager', 'tour']);const fm = FileManager.create(hostIn(filesSection), { label: 'Company documents', root: { id: null, label: 'Documents' }, provider, height: '30rem', maxFileSize: 5_000_000,});const fmStatus = status(filesSection);fmStatus.textContent = 'Open a photo or a file (Enter or double click) to preview it.';sc.listen(fm.host, ['aui-navigate', 'aui-change', 'aui-open', 'aui-create-folder', 'aui-rename', 'aui-move', 'aui-delete', 'aui-upload', 'aui-error'], 'file-manager');
// The tour walks every section, so every section lists it.const previewSection = section(sc, 'Photos', ['image-viewer', 'tour']);const images = (): ImageViewerImage[] => children('photos') .filter((e) => e.mimeType?.startsWith('image/') === true) .map((e) => ({ src: stored(e.id).url ?? '', alt: `Badge photo of ${e.name.replace(/\.png$/, '')}`, caption: e.name, downloadName: e.name })) .filter((i) => i.src !== '');const viewer = ImageViewer.create(hostIn(previewSection), { label: 'Badge photos', images: images(), croppable: true, aspectRatios: [{ label: 'Badge (1:1)', value: 1 }, { label: '4:3', value: 4 / 3 }, { label: 'Free', value: null }] });sc.listen(viewer.host, ['aui-change', 'aui-zoom', 'aui-rotate', 'aui-crop', 'aui-error'], 'image-viewer');
const LANGUAGES: Readonly<Record<string, CodeLanguage>> = { json: 'json', ts: 'typescript', js: 'javascript', md: 'markdown', sql: 'sql', css: 'css', html: 'html', sh: 'bash' };const languageOf = (name: string): CodeLanguage => LANGUAGES[name.split('.').pop()?.toLowerCase() ?? ''] ?? 'plain';let diffMode: 'unified' | 'split' = 'unified';let showDiff = true;let current = stored('leave-policy');const codeSection = section(sc, 'File preview', ['code-viewer', 'tour']);const code = CodeViewer.create(hostIn(codeSection), { label: 'File preview', filename: current.entry.name, language: 'json', diff: { original: policyBefore, modified: policyAfter, mode: diffMode, originalLabel: 'Previous version', modifiedLabel: 'Current version' } });sc.listen(code.host, ['aui-copy', 'aui-change'], 'code-viewer');
function showCode(s: Stored): void { current = s; const text = s.text ?? ''; const language = languageOf(s.entry.name); if (showDiff && s.previous !== undefined) code.update({ filename: s.entry.name, language, code: '', diff: { original: s.previous, modified: text, mode: diffMode, originalLabel: 'Previous version', modifiedLabel: 'Current version' } }); else code.update({ filename: s.entry.name, language, diff: null, code: text });}
fm.host.addEventListener('aui-open', (event) => { const { entry } = (event as CustomEvent<FileManagerOpenDetail>).detail; const s = store.get(entry.id); if (!s) return; // The page shows previews inline instead of the File Manager's dialog, unless the preview // section is hidden (the File Manager's focus view on a component page). const inline = s.url !== undefined ? !previewSection.hidden : s.text !== undefined && !codeSection.hidden; if (!inline) return; event.preventDefault(); if (s.url !== undefined) { const list = images(); viewer.update({ images: list, index: Math.max(0, list.findIndex((i) => i.caption === entry.name)) }); fmStatus.textContent = `Showing ${entry.name} in the image viewer.`; viewer.host.scrollIntoView({ block: 'nearest' }); } else if (s.text !== undefined) { showCode(s); fmStatus.textContent = s.previous === undefined ? `Showing ${entry.name}.` : `Showing the changes to ${entry.name}.`; code.host.scrollIntoView({ block: 'nearest' }); }});
const activitySection = section(sc, 'Activity', ['timeline', 'tour']);const timeline = Timeline.create(hostIn(activitySection), { label: 'Document activity', items: activity, initialVisible: 4, hasMore: true, loadMore: async ({ signal }) => { await wait(500, signal); olderPages--; const base = 24 * (6 + (2 - olderPages) * 3); return [ { id: `old-${String(olderPages)}-1`, title: 'Contract template replaced', tone: 'info', time: ago(base), avatar: { name: 'Ada Lovelace' } }, { id: `old-${String(olderPages)}-2`, title: 'Archive folder cleaned up', tone: 'warning', description: '12 files older than seven years removed.', time: ago(base + 30) }, ]; },});sc.listen(timeline.host, ['aui-action', 'aui-toggle', 'aui-load-more', 'aui-load-error'], 'timeline');timeline.host.addEventListener('aui-load-more', () => { if (olderPages <= 0) timeline.update({ hasMore: false });});timeline.host.addEventListener('aui-action', (event) => { const { item } = (event as CustomEvent<TimelineActionDetail>).detail; const target = item.id === 'a2' ? [...store.values()].find((s) => s.entry.name === 'Employee handbook.md') : stored('leave-policy'); if (target) { showDiff = true; showCode(target); code.host.scrollIntoView({ block: 'nearest' }); }});
function record(title: string, tone: TimelineTone, description?: string): void { activity.unshift({ id: `live-${String(activityId++)}`, title, tone, time: instant(Date.now()), avatar: { name: 'You' }, ...(description === undefined ? {} : { description }) }); timeline.update({ items: [...activity] });}const names = (list: readonly FileEntry[]): string => list.map((e) => e.name).join(', ');fm.host.addEventListener('aui-create-folder', (e) => { record('Folder created', 'success', (e as CustomEvent<FileManagerCreateFolderDetail>).detail.entry.name);});fm.host.addEventListener('aui-rename', (e) => { const d = (e as CustomEvent<FileManagerRenameDetail>).detail; record('Renamed', 'info', `${d.previousName} to ${d.entry.name}`);});fm.host.addEventListener('aui-move', (e) => { record('Moved', 'info', names((e as CustomEvent<FileManagerMoveDetail>).detail.entries));});fm.host.addEventListener('aui-delete', (e) => { record('Deleted', 'warning', names((e as CustomEvent<FileManagerDeleteDetail>).detail.entries));});fm.host.addEventListener('aui-upload', (e) => { record('Uploaded', 'success', (e as CustomEvent<FileManagerUploadDetail>).detail.entry.name);});fm.host.addEventListener('aui-error', (e) => { const d = (e as CustomEvent<FileManagerErrorDetail>).detail; record(`Failed: ${d.operation}`, 'error', d.error instanceof Error ? d.error.message : undefined);});
// Guided tour of the page.const tour = Tour.create(hostIn(filesSection), { dots: true, steps: [ { id: 'welcome', title: 'Welcome to the document center', content: 'A short tour: files, previews, and activity. Press Escape to leave at any time.' }, { id: 'toolbar', title: 'File actions', content: 'Create folders, upload, rename, delete, cut and paste, sort, and switch between list and grid.', target: () => fm.host.querySelector('[role="toolbar"]'), placement: 'bottom-start' }, { id: 'folders', title: 'Folders', content: 'Browse the folder tree; drop files on a folder to move them.', target: () => fm.host.querySelector('.aui-file-manager__folders'), placement: 'right' }, { id: 'photos', title: 'Photo viewer', content: 'Zoom, rotate, and crop badge photos to a square.', target: () => viewer.host, placement: 'top' }, { id: 'code', title: 'Compare versions', content: 'See what changed in a file, unified or side by side.', target: () => code.host, placement: 'top' }, { id: 'activity', title: 'Activity', content: 'Every change you make is added here, grouped by day.', target: () => timeline.host, placement: 'top' }, ],});sc.listen(tour.host, ['aui-start', 'aui-step-change', 'aui-step-missing', 'aui-finish', 'aui-skip'], 'tour');
// Options.action(sc, 'Start tour', () => { void tour.start();}, ['tour']);choice(sc, 'View', [{ value: 'list', label: 'List' }, { value: 'grid', label: 'Grid' }], 'list', (view) => { fm.update({ view });}, ['file-manager']);toggle(sc, 'Folder pane', true, (checked) => { fm.update({ showFolderPane: checked });}, ['file-manager']);toggle(sc, 'Read-only', false, (checked) => { fm.update({ readOnly: checked });}, ['file-manager']);toggle(sc, 'Show changes', true, (checked) => { showDiff = checked; showCode(current);}, ['code-viewer']);choice(sc, 'Diff layout', [{ value: 'unified', label: 'Unified' }, { value: 'split', label: 'Side by side' }], 'unified', (mode) => { diffMode = mode; showCode(current);}, ['code-viewer']);choice(sc, 'Timeline layout', [{ value: 'start', label: 'Start' }, { value: 'alternate', label: 'Alternate' }], 'start', (layout) => { timeline.update({ layout });}, ['timeline']);choice(sc, 'Times', [{ value: 'relative', label: 'Relative' }, { value: 'absolute', label: 'Absolute' }], 'relative', (timeFormat) => { timeline.update({ timeFormat });}, ['timeline']);timeline.update({ timeFormat: 'relative' });Document activity grouped by day
Section titled “Document activity grouped by day”import { instant } from '@absoluteui/core';import { Timeline, type TimelineActionDetail } from '@absoluteui/components/timeline';
const host = document.createElement('div');document.body.append(host);Timeline.create(host, { label: 'Document activity', timezone: 'Europe/London', now: instant(Date.UTC(2026, 10, 23, 15)), items: [ { id: 'a3', title: 'Policy approved', tone: 'success', time: instant(Date.UTC(2026, 10, 23, 14, 5)), avatar: { name: 'Ada Lovelace' } }, { id: 'a2', title: 'Review requested', tone: 'info', time: instant(Date.UTC(2026, 10, 23, 9, 30)), actions: [{ id: 'open', label: 'Open review' }] }, { id: 'a1', title: 'Draft uploaded', time: instant(Date.UTC(2026, 10, 20, 16, 0)), description: 'leave-policy.docx, 48 kB' }, ],});host.addEventListener('aui-action', (event) => { const { itemId, actionId } = (event as CustomEvent<TimelineActionDetail>).detail; host.dataset.last = `${itemId}:${actionId}`;});Collapsed older items and load more
Section titled “Collapsed older items and load more”import { instant } from '@absoluteui/core';import { Timeline, type TimelineItem } from '@absoluteui/components/timeline';
const host = document.createElement('div');document.body.append(host);const start = Date.UTC(2026, 10, 23, 12);const page = (from: number): TimelineItem[] => Array.from({ length: 10 }, (_, i) => ({ id: `e${String(from + i)}`, title: `Event ${String(from + i)}`, time: instant(start - (from + i) * 3_600_000) }));let loaded = 10;Timeline.create(host, { label: 'Audit log', timeFormat: 'relative', now: instant(start), items: page(0), initialVisible: 5, loadMore: async ({ signal }) => { await new Promise((resolve) => setTimeout(resolve, 100)); if (signal.aborted) return []; const next = loaded < 30 ? page(loaded) : []; loaded += next.length; return next; },});Horizontal milestones with a business calendar
Section titled “Horizontal milestones with a business calendar”import { plainDate } from '@absoluteui/core';import { createBusinessCalendar } from '@absoluteui/components/business-calendar';import { Timeline } from '@absoluteui/components/timeline';
const host = document.createElement('div');document.body.append(host);const calendar = createBusinessCalendar({ holidays: [{ name: 'Christmas Day', date: plainDate(2026, 12, 25), yearly: true }] });Timeline.create(host, { label: 'Onboarding plan', orientation: 'horizontal', order: 'oldest-first', businessCalendar: calendar, items: [ { id: 'offer', title: 'Offer signed', tone: 'success', time: plainDate(2026, 12, 1) }, { id: 'laptop', title: 'Laptop shipped', tone: 'info', time: plainDate(2026, 12, 14) }, { id: 'office', title: 'Office closed', tone: 'warning', time: plainDate(2026, 12, 25) }, { id: 'start', title: 'First day', time: plainDate(2027, 1, 4) }, ],});Install and start
Section titled “Install and start”npm install @absoluteui/components @absoluteui/core @absoluteui/themeRegistry setup, the theme stylesheet, and the Content Security Policy are covered in Installation.
import { Timeline } from '@absoluteui/components/timeline';import '@absoluteui/components/button/style.css';import '@absoluteui/components/avatar/style.css';import '@absoluteui/components/timeline/style.css';First use
Section titled “First use”import { plainDate } from '@absoluteui/core';import { Timeline } from '@absoluteui/components/timeline';import '@absoluteui/components/button/style.css';import '@absoluteui/components/avatar/style.css';import '@absoluteui/components/timeline/style.css';
const host = document.querySelector<HTMLElement>('#milestones');if (host) { Timeline.create(host, { label: 'Project milestones', orientation: 'horizontal', order: 'oldest-first', items: [ { id: 'kickoff', title: 'Kick-off', tone: 'success', time: plainDate(2026, 11, 2) }, { id: 'beta', title: 'Beta', tone: 'info', time: plainDate(2026, 12, 7) }, ], });}More usage
import { instant } from '@absoluteui/core';import { Timeline, type TimelineLoadMoreDetail } from '@absoluteui/components/timeline';
const host = document.querySelector<HTMLElement>('#activity');if (host) { const timeline = Timeline.create(host, { label: 'Case history', timeFormat: 'relative', items: [{ id: 'c1', title: 'Case opened', tone: 'info', time: instant(Date.now() - 3_600_000) }], loadMore: async () => [], }); host.addEventListener('aui-load-more', (event) => { if (!(event as CustomEvent<TimelineLoadMoreDetail>).detail.hasMore) timeline.update({ empty: 'Nothing older.' }); });}Using Angular? See Timeline for Angular.
API reference
Section titled “API reference”Factory
Section titled “Factory”Timeline.create(host: HTMLElement, options: TimelineOptions): TimelineGlobal configuration key: timeline (see Configuration).
Options
Section titled “Options”| Option | Type | Default | Description |
|---|---|---|---|
label |
string |
Accessible name of the list (and of the scroll region when horizontal). Required. | |
items |
readonly TimelineItem[] |
Items in display order: { id, title, time?, description?, tone?, status?, icon?, avatar?, href?, actions? }. Required. | |
order |
'newest-first' | 'oldest-first' |
"newest-first" |
Order of items; older items collapse and load at the older end. |
initialVisible |
number | null |
"null" |
Show this many items and collapse the older rest behind ‘Show N older’. |
loadMore |
((context: TimelineLoadContext) => Promise<readonly TimelineItem[]>) | null |
"null" |
Fetch older items; the context has an AbortSignal and the oldest item. |
hasMore |
boolean |
"true when loadMore is set" |
More items can be loaded; an empty result sets it to false. |
businessCalendar |
BusinessCalendarEngine | null |
"null" |
Names holidays and non-working days in day headings. |
headingLevel |
2 | 3 | 4 | 5 | 6 |
"3" |
Heading level of day headings. |
now |
Instant |
"the current instant" |
Reference for relative times and ‘Today’. |
empty |
string |
"localized 'No activity yet.'" |
Text when there are no items. |
icons |
Partial<TimelineIcons> |
Tone markers, ‘Show older’, and retry icons. | |
orientation |
'vertical' | 'horizontal' |
"vertical" |
Direction of the line. Globally configurable. |
layout |
'start' | 'alternate' |
"start" |
Items on one side, or alternating sides (vertical). Globally configurable. |
timeFormat |
'relative' | 'absolute' |
"absolute" |
‘3 hours ago’ or a formatted time; the full date is always in the title and datetime. Globally configurable. |
groupByDay |
boolean |
"true" |
Group consecutive items of the same day under a day heading. Globally configurable. |
locale |
string |
Locale for dates, numbers, and messages. Globally configurable. Inherited from common configuration. | |
timezone |
string |
IANA timezone for grouping and formatting instants. Globally configurable. Inherited from common configuration. |
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
host |
HTMLElement |
The host element. |
options |
Readonly<TimelineOptions> |
Current options. |
items |
TimelineItem[] |
Every item in display order, including loaded ones. |
expanded |
boolean |
Older items are shown. |
hasMore |
boolean |
More items can be loaded. |
loading |
boolean |
loadMore is running. |
Methods
Section titled “Methods”| Method | Description |
|---|---|
update(options: Partial<TimelineOptions>): void |
Merge and apply options; new items replace loaded ones. |
setExpanded(expanded: boolean): void |
Show or collapse older items (no event). |
loadOlder(): Promise<void> |
Run loadMore as the ‘Load older’ button does. |
destroy(): void |
Abort loading and remove rendering, buttons, avatars, and listeners. |
Events
Section titled “Events”| Event | Detail | Bubbles | Cancelable | Description |
|---|---|---|---|---|
aui-action |
TimelineActionDetail |
Yes | No | An item action was activated: { itemId, actionId, item }. |
aui-toggle |
TimelineToggleDetail |
Yes | No | Older items were shown or collapsed: { expanded }. |
aui-load-more |
TimelineLoadMoreDetail |
Yes | No | loadMore resolved: { items, hasMore }. |
aui-load-error |
TimelineLoadErrorDetail |
Yes | No | loadMore rejected or returned invalid items: { error }. |
CSS classes
Section titled “CSS classes”All rules live in the aui.components cascade layer, so application styles override them without specificity battles.
| Class | Purpose |
|---|---|
aui-timeline |
Host. |
aui-timeline--vertical | --horizontal |
Orientation. |
aui-timeline--alternate |
Alternate layout. |
aui-timeline--grouped |
Grouped by day. |
aui-timeline__scroller |
Scroll container (a focusable region when horizontal). |
aui-timeline__list |
The outer ordered list. |
aui-timeline__group |
A day group (list item). |
aui-timeline__day |
Day heading. |
aui-timeline__items |
Ordered list of items. |
aui-timeline__item |
An item; aui-timeline__item–<tone> and –end (alternate). |
aui-timeline__marker |
Icon or avatar marker (aria-hidden). |
aui-timeline__content |
Title, status, time, description, actions. |
aui-timeline__title | __status | __time | __description | __actions |
Item parts. |
aui-timeline__footer |
‘Show older’ and ‘Load older’ buttons and the error message. |
aui-timeline__toggle | __load | __error | __empty |
Footer parts and the empty text. |
Icon slots
Section titled “Icon slots”| Slot | Default icon |
|---|---|
neutral |
circle (icon set) |
info |
info |
success |
check-circle |
warning |
alert-triangle |
error |
alert-circle |
showOlder |
chevron-down |
retry |
refresh |
Design tokens
Section titled “Design tokens”Tokens this stylesheet reads (verified in CI). Override them in a theme or with the Theme Designer.
--aui-border-width-strong | --aui-color-border-strong | --aui-color-error-fg | --aui-color-focus-ring | --aui-color-info-fg | --aui-color-link | --aui-color-success-fg | --aui-color-surface | --aui-color-text | --aui-color-text-muted | --aui-color-warning-fg | --aui-focus-ring-offset | --aui-focus-ring-width | --aui-font-family-sans | --aui-font-size-md | --aui-font-size-sm | --aui-font-weight-medium | --aui-font-weight-semibold | --aui-icon-size-md | --aui-line-height-normal | --aui-line-height-tight | --aui-radius-md | --aui-radius-pill | --aui-radius-sm | --aui-space-1 | --aui-space-2 | --aui-space-3 | --aui-space-4
TypeScript definitions
type TimelineTone = 'neutral' | 'info' | 'success' | 'warning' | 'error';type TimelineOrientation = 'vertical' | 'horizontal';type TimelineLayout = 'start' | 'alternate';type TimelineTimeFormat = 'relative' | 'absolute';type TimelineOrder = 'newest-first' | 'oldest-first';interface TimelineConfig { orientation: TimelineOrientation; layout: TimelineLayout; timeFormat: TimelineTimeFormat; groupByDay: boolean }interface TimelineAction { id: string; label: string; icon?: IconRef }interface TimelineAvatar { name: string; src?: string }interface TimelineItem { id: string; title: string; time?: Instant | PlainDate; description?: string; tone?: TimelineTone; status?: string; icon?: IconRef; avatar?: TimelineAvatar; href?: string; actions?: readonly TimelineAction[];}interface TimelineLoadContext { readonly signal: AbortSignal; readonly oldest: TimelineItem | null }interface TimelineOptions extends Partial<TimelineConfig> { label: string; items: readonly TimelineItem[]; order?: TimelineOrder; initialVisible?: number | null; loadMore?: ((context: TimelineLoadContext) => Promise<readonly TimelineItem[]>) | null; hasMore?: boolean; businessCalendar?: BusinessCalendarEngine | null; headingLevel?: 2 | 3 | 4 | 5 | 6; now?: Instant; empty?: string; locale?: string; timezone?: string; icons?: Partial<TimelineIcons>;}interface TimelineActionDetail { itemId: string; actionId: string; item: TimelineItem }interface TimelineToggleDetail { expanded: boolean }interface TimelineLoadMoreDetail { items: TimelineItem[]; hasMore: boolean }interface TimelineLoadErrorDetail { error: unknown }Accessibility and performance
Section titled “Accessibility and performance”Accessibility
Section titled “Accessibility”Pattern: Structured content: an ordered list of events (day groups as list items with a heading and a nested ordered list); native links and buttons for actions; a horizontal timeline is a focusable, labelled scroll region.
Checked on every docs build: the showcase passes axe (WCAG 2.2 A and AA rules) in the default, dark, and high-contrast themes and right to left; the playground loads without errors and passes axe before and after every on/off option is switched, with no Content Security Policy violations.
Keyboard
Section titled “Keyboard”| Key | Context | Action |
|---|---|---|
| Tab | Timeline | Item links and action buttons in order, then ‘Show older’ or ‘Load older’. |
| Enter / Space | Action or footer button | Activate (Enter for links). |
| Arrow keys / Home / End | Horizontal scroll region (focused) | Scroll the timeline. |
| Element | Role |
|---|---|
| list | list (ol) named by label |
| day group | listitem with a heading (h2 to h6) and a nested list named by the heading |
| item | listitem |
| scroller (horizontal) | region named by label, tabindex=0 |
| item actions | group named by the item title, containing native buttons |
ARIA attributes
Section titled “ARIA attributes”| Attribute | Element | Value |
|---|---|---|
aria-label |
list | label |
aria-labelledby |
nested list | the day heading |
aria-hidden |
marker | true (the tone is also a status word) |
aria-expanded / aria-controls |
‘Show older’ button | older items shown; controls the list |
datetime / title |
time | ISO date-time and the full localized date |
After ‘Show older’ or a successful load, focus moves to the first newly shown item (tabindex=-1, removed on blur); while loading and on error, focus stays on the rebuilt footer button.
WCAG 2.2 success criteria addressed
Section titled “WCAG 2.2 success criteria addressed”| Criterion | Level | Note |
|---|---|---|
| 1.1.1 Non-text Content | A | |
| 1.3.1 Info and Relationships | A | |
| 1.4.1 Use of Color | A | |
| 1.4.3 Contrast (Minimum) | AA | |
| 1.4.11 Non-text Contrast | AA | |
| 2.1.1 Keyboard | A | |
| 2.4.3 Focus Order | A | |
| 2.4.6 Headings and Labels | AA | |
| 4.1.2 Name, Role, Value | A | |
| 4.1.3 Status Messages | AA |
Automated test results: Accessibility and compliance.
Notes and known caveats
Section titled “Notes and known caveats”- Tone is never color only: the marker icon differs per tone and a status word is shown (override it with status).
- Loading, results, and errors are announced politely (errors assertively).
- Day headings say ‘Today’, ‘Yesterday’, a weekday, or a date, and name holidays and non-working days with a business calendar.
- Manual screen-reader verification (NVDA, JAWS, VoiceOver) is pending.
Performance
Section titled “Performance”| Import cost | Minified | gzip | brotli | CSS brotli |
|---|---|---|---|---|
@absoluteui/components/timeline |
63.1 kB | 21.4 kB | 19.1 kB | 1.2 kB |
Measured at build time, including every AbsoluteUI module the component pulls in. No third-party runtime dependencies.
| Budget (enforced in CI) | Limit |
|---|---|
| Timeline.create with 1,000 items grouped by day | < 60 ms in headless Chromium |
| Timeline.create with initialVisible 20 of 1,000 items | < 8 ms in headless Chromium |
Tested scale: Up to 10,000 items in memory; use initialVisible or loadMore to keep the DOM to a few hundred items.
Rendering is one pass over the shown items; collapsed older items are not in the DOM. update() re-renders the list. The timeline is not virtualized: keep it to a few hundred rendered items with initialVisible or loadMore.
Measured run times: Performance.
Details
Section titled “Details”States
Vertical, horizontal, alternate; grouped or ungrouped; relative or absolute times; older items collapsed or expanded; loading more; load error; no more items; empty; tones neutral, info, success, warning, error.
State transitions
| From | Trigger | To |
|---|---|---|
| collapsed | “Show N older” | expanded; focus on the first shown item; aui-toggle |
| expanded | “Show fewer” | collapsed; focus stays on the button; aui-toggle |
| idle | “Load older” or loadOlder() |
loading (button busy, announced) |
| loading | loadMore resolves |
idle; items appended, focus on the first new item; aui-load-more |
| loading | loadMore resolves [] |
no more items; the button is removed |
| loading | loadMore rejects |
error message and Retry; aui-load-error |
| any | update(options) |
re-rendered; new items drop loaded items |
Accessibility notes
- Tone is never color only: each tone has its own marker icon and a status word (override it with
status, such as “Approved”). - Loading, loaded counts, and “No older items” are announced politely, errors assertively.
- After revealing or loading items, focus moves to the first new item so keyboard users continue reading there.
- The e2e axe run covers three themes; manual screen-reader verification is pending.
Responsive behavior
Vertical timelines are fluid and wrap long titles; alternate timelines keep two equal columns; horizontal timelines scroll inside their region with items of 14rem.
Right-to-left
The line, markers, and alternate sides mirror with the writing direction; horizontal timelines start at the right.
Theming
Marker colors come from the tone tokens in every theme; text uses color-text and color-text-muted (contrast gate). Forced colors render markers and the line in CanvasText on Canvas. There is no animation, so reduced-motion settings need no special case.
Global configuration
configureAbsoluteUI({ components: { timeline: { timeFormat: 'relative', groupByDay: false } } });Component configuration
Instance orientation, layout, timeFormat, groupByDay, locale, and timezone override configuration.
Timezones
Instants are grouped into days and formatted in the configured timezone (timezone option or common configuration). PlainDate items are all-day: they never shift between zones and show “All day” when grouped. “Today” is computed from now in that zone. With businessCalendar, day headings name holidays (“Fri, 25 Dec (Christmas Day)”) and non-working days.
Icons
icons.neutral, icons.info, icons.success, icons.warning, icons.error (tone markers; defaults circle from the icon set, info, check-circle, alert-triangle, alert-circle), icons.showOlder (chevron-down), and icons.retry (refresh). Per item, icon overrides the tone icon and avatar replaces it.
Security
Titles, descriptions, status words, and action labels are set as text. Item href values are limited to http(s) and relative URLs, and avatar src values to safe image URLs; anything else throws TIMELINE_OPTIONS. Items returned by loadMore are validated the same way (an invalid result is reported as a load error).
Data handling
No persistence, network access, or telemetry. loadMore is host code; it receives an AbortSignal that aborts when the timeline is destroyed.
Supported data scale
Up to 10,000 items in memory; 1,000 rendered items within the declared budget.
Edge cases
- Items without
timegroup under “No date”. - Items of the same day that are not adjacent form separate groups (the given order wins).
layout: 'alternate'is ignored whenorientationishorizontal.- With
order: 'oldest-first', older items collapse and load at the start of the list. - A
loadMorethat resolves afterdestroy()is ignored.
Errors
| Code | Category | Cause |
|---|---|---|
TIMELINE_OPTIONS |
configuration | Blank label, items that are not an array, an item without id or title, a duplicate id, an invalid time, tone, href, avatar, or action, an invalid initialVisible, order, headingLevel, now, businessCalendar, or a non-function loadMore. |
CFG_INVALID_VALUE / CFG_UNKNOWN_OPTION |
configuration | Invalid or unknown configuration. |
ICON_UNKNOWN |
configuration | An icon that is not registered. |
Invalid options throw before the host is modified; an invalid update() leaves the previous state intact. A failing loadMore never throws: it shows an error with Retry and emits aui-load-error.
Known limitations
- Not virtualized.
- Relative times are computed at render; call
update({ now })to refresh them. - Manual screen-reader verification is pending.
Unsupported scenarios
- Rich text (HTML) in titles or descriptions.
- Durations or overlapping ranges on a time axis: use Gantt.
(c) 2026 Kasadara Technology Solutions Pvt Ltd. AbsoluteUI is free to use under the AbsoluteUI Free Use License; it is not open source.