Timeline
Preview
Use the left and right arrow keys to move between events.
Jun 12 ’25
Private beta opens
1,204Aug 3 ’25
Lumen for Android
3,918Oct 14 ’25
Offline drafts
4,827Nov 20 ’25
Weekly signups double
6,175Jan 9 ’26
Shared spaces
2,640Mar 17 ’26
The command menu
⌘K5,302May 28 ’26
Top 10 in productivity
13,916Aug 5 ’26
Lumen 2.0
2.027,130
<script setup lang="ts">
import { Timeline } from 'beui-vue'
import { ref, defineComponent, h, type PropType } from 'vue'
/** Inline Lucide glyphs for the layout demos (generated from lucide-react, ISC). Inner markup of 24x24 stroked icons. */
const ICONS: Record<string, string> = {
"ArrowRight": "<path d=\"M5 12h14\"></path><path d=\"m12 5 7 7-7 7\"></path>",
"ArrowUp": "<path d=\"m5 12 7-7 7 7\"></path><path d=\"M12 19V5\"></path>",
"ArrowUpRight": "<path d=\"M7 7h10v10\"></path><path d=\"M7 17 17 7\"></path>",
"BarChart3": "<path d=\"M3 3v16a2 2 0 0 0 2 2h16\"></path><path d=\"M18 17V9\"></path><path d=\"M13 17V5\"></path><path d=\"M8 17v-3\"></path>",
"Bell": "<path d=\"M10.268 21a2 2 0 0 0 3.464 0\"></path><path d=\"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\"></path>",
"Braces": "<path d=\"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1\"></path><path d=\"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1\"></path>",
"Building2": "<path d=\"M10 12h4\"></path><path d=\"M10 8h4\"></path><path d=\"M14 21v-3a2 2 0 0 0-4 0v3\"></path><path d=\"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2\"></path><path d=\"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16\"></path>",
"Calendar": "<path d=\"M8 2v3\"></path><path d=\"M16 2v3\"></path><rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2\"></rect><path d=\"M3 9h18\"></path>",
"CalendarClock": "<path d=\"M16 14v2.2l1.6 1\"></path><path d=\"M16 2v3\"></path><path d=\"M21 7.338V5a2 2 0 00-2-2H5a2 2 0 00-2 2v14a2 2 0 002 2h2.338\"></path><path d=\"M3 9h5.859\"></path><path d=\"M8 2v3\"></path><circle cx=\"16\" cy=\"16\" r=\"6\"></circle>",
"Check": "<path d=\"M20 6 9 17l-5-5\"></path>",
"CheckCircle2": "<circle cx=\"12\" cy=\"12\" r=\"10\"></circle><path d=\"m9 12 2 2 4-4\"></path>",
"ChevronDown": "<path d=\"m6 9 6 6 6-6\"></path>",
"ChevronLeft": "<path d=\"m15 18-6-6 6-6\"></path>",
"ChevronRight": "<path d=\"m9 18 6-6-6-6\"></path>",
"ChevronUp": "<path d=\"m18 15-6-6-6 6\"></path>",
"ChevronsUpDown": "<path d=\"m7 15 5 5 5-5\"></path><path d=\"m7 9 5-5 5 5\"></path>",
"Circle": "<circle cx=\"12\" cy=\"12\" r=\"10\"></circle>",
"CircleUserRound": "<path d=\"M17.925 20.056a6 6 0 0 0-11.851.001\"></path><circle cx=\"12\" cy=\"11\" r=\"4\"></circle><circle cx=\"12\" cy=\"12\" r=\"10\"></circle>",
"Command": "<path d=\"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3\"></path>",
"File": "<path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path>",
"FileCode2": "<path d=\"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"m5 16-3 3 3 3\"></path><path d=\"m9 22 3-3-3-3\"></path>",
"FileJson2": "<path d=\"M14 22h4a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v6\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M5 14a1 1 0 0 0-1 1v2a1 1 0 0 1-1 1 1 1 0 0 1 1 1v2a1 1 0 0 0 1 1\"></path><path d=\"M9 22a1 1 0 0 0 1-1v-2a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-2a1 1 0 0 0-1-1\"></path>",
"FileText": "<path d=\"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\"></path><path d=\"M14 2v5a1 1 0 0 0 1 1h5\"></path><path d=\"M10 9H8\"></path><path d=\"M16 13H8\"></path><path d=\"M16 17H8\"></path>",
"Folder": "<path d=\"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\"></path>",
"FolderKanban": "<path d=\"M4 20h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.93a2 2 0 0 1-1.66-.9l-.82-1.2A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13c0 1.1.9 2 2 2Z\"></path><path d=\"M8 10v4\"></path><path d=\"M12 10v2\"></path><path d=\"M16 10v6\"></path>",
"FolderOpen": "<path d=\"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2\"></path>",
"GitPullRequest": "<circle cx=\"18\" cy=\"18\" r=\"3\"></circle><circle cx=\"6\" cy=\"6\" r=\"3\"></circle><path d=\"M13 6h3a2 2 0 0 1 2 2v7\"></path><line x1=\"6\" x2=\"6\" y1=\"9\" y2=\"21\"></line>",
"GripVertical": "<circle cx=\"9\" cy=\"12\" r=\"1\"></circle><circle cx=\"9\" cy=\"5\" r=\"1\"></circle><circle cx=\"9\" cy=\"19\" r=\"1\"></circle><circle cx=\"15\" cy=\"12\" r=\"1\"></circle><circle cx=\"15\" cy=\"5\" r=\"1\"></circle><circle cx=\"15\" cy=\"19\" r=\"1\"></circle>",
"Heart": "<path d=\"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5\"></path>",
"Home": "<path d=\"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\"></path><path d=\"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\"></path>",
"House": "<path d=\"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\"></path><path d=\"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\"></path>",
"Inbox": "<polyline points=\"22 12 16 12 14 15 10 15 8 12 2 12\"></polyline><path d=\"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\"></path>",
"Layers": "<path d=\"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z\"></path><path d=\"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12\"></path><path d=\"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17\"></path>",
"LayoutGrid": "<rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\"></rect><rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\"></rect><rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\"></rect><rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\"></rect>",
"ListTodo": "<path d=\"M13 5h8\"></path><path d=\"M13 12h8\"></path><path d=\"M13 19h8\"></path><path d=\"m3 17 2 2 4-4\"></path><rect x=\"3\" y=\"4\" width=\"6\" height=\"6\" rx=\"1\"></rect>",
"LoaderCircle": "<path d=\"M21 12a9 9 0 1 1-6.219-8.56\"></path>",
"Mail": "<path d=\"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7\"></path><rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\"></rect>",
"MessageCircle": "<path d=\"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719\"></path>",
"Minus": "<path d=\"M5 12h14\"></path>",
"Music": "<path d=\"M9 18V5l12-2v13\"></path><circle cx=\"6\" cy=\"18\" r=\"3\"></circle><circle cx=\"18\" cy=\"16\" r=\"3\"></circle>",
"NotebookTabs": "<path d=\"M2 6h4\"></path><path d=\"M2 10h4\"></path><path d=\"M2 14h4\"></path><path d=\"M2 18h4\"></path><rect width=\"16\" height=\"20\" x=\"4\" y=\"2\" rx=\"2\"></rect><path d=\"M15 2v20\"></path><path d=\"M15 7h5\"></path><path d=\"M15 12h5\"></path><path d=\"M15 17h5\"></path>",
"PackageCheck": "<path d=\"M12 22V12\"></path><path d=\"m16 17 2 2 4-4\"></path><path d=\"M21 11.127V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.729l7 4a2 2 0 0 0 2 .001l1.32-.753\"></path><path d=\"M3.29 7 12 12l8.71-5\"></path><path d=\"m7.5 4.27 8.997 5.148\"></path>",
"Palette": "<path d=\"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z\"></path><circle cx=\"13.5\" cy=\"6.5\" r=\".5\" fill=\"currentColor\"></circle><circle cx=\"17.5\" cy=\"10.5\" r=\".5\" fill=\"currentColor\"></circle><circle cx=\"6.5\" cy=\"12.5\" r=\".5\" fill=\"currentColor\"></circle><circle cx=\"8.5\" cy=\"7.5\" r=\".5\" fill=\"currentColor\"></circle>",
"PanelLeft": "<rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\"></rect><path d=\"M9 3v18\"></path>",
"Plus": "<path d=\"M5 12h14\"></path><path d=\"M12 5v14\"></path>",
"RadioTower": "<path d=\"M4.9 16.1C1 12.2 1 5.8 4.9 1.9\"></path><path d=\"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5\"></path><circle cx=\"12\" cy=\"9\" r=\"2\"></circle><path d=\"M16.2 4.8c2 2 2.26 5.11.8 7.47\"></path><path d=\"M19.1 1.9a9.96 9.96 0 0 1 0 14.1\"></path><path d=\"M9.5 18h5\"></path><path d=\"m8 22 4-11 4 11\"></path>",
"Rocket": "<path d=\"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\"></path><path d=\"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09\"></path><path d=\"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z\"></path><path d=\"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05\"></path>",
"Search": "<path d=\"m21 21-4.34-4.34\"></path><circle cx=\"11\" cy=\"11\" r=\"8\"></circle>",
"Settings": "<path d=\"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\"></path><circle cx=\"12\" cy=\"12\" r=\"3\"></circle>",
"ShieldCheck": "<path d=\"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\"></path><path d=\"m9 12 2 2 4-4\"></path>",
"Sparkles": "<path d=\"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\"></path><path d=\"M20 2v4\"></path><path d=\"M22 4h-4\"></path><circle cx=\"4\" cy=\"20\" r=\"2\"></circle>",
"Target": "<circle cx=\"12\" cy=\"12\" r=\"10\"></circle><circle cx=\"12\" cy=\"12\" r=\"6\"></circle><circle cx=\"12\" cy=\"12\" r=\"2\"></circle>",
"Undo2": "<path d=\"M9 14 4 9l5-5\"></path><path d=\"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11\"></path>",
"Workflow": "<rect width=\"8\" height=\"8\" x=\"3\" y=\"3\" rx=\"2\"></rect><path d=\"M7 11v4a2 2 0 0 0 2 2h4\"></path><rect width=\"8\" height=\"8\" x=\"13\" y=\"13\" rx=\"2\"></rect>",
"X": "<path d=\"M18 6 6 18\"></path><path d=\"m6 6 12 12\"></path>"
}
export type LucideName = string
export const LucideIcon = defineComponent({
name: 'LucideIcon',
props: { name: { type: String as PropType<LucideName>, required: true }, size: { type: Number, default: 16 }, strokeWidth: { type: Number, default: 2 } },
setup: props => () => h('svg', {
xmlns: 'http://www.w3.org/2000/svg', width: props.size, height: props.size, viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor',
'stroke-width': props.strokeWidth, 'stroke-linecap': 'round', 'stroke-linejoin': 'round', 'aria-hidden': 'true', innerHTML: ICONS[props.name] ?? '',
}),
})
const active = ref('signups')
function chart(points: number[]) {
const max = Math.max(...points)
const path = points.map((p, i) => {
const x = (i / (points.length - 1)) * 100
const y = 56 - (p / max) * 44
return `${i === 0 ? 'M' : 'L'}${x.toFixed(1)} ${y.toFixed(1)}`
}).join(' ')
return { line: path, area: `${path} L100 64 L0 64 Z` }
}
const SIGNUPS = chart([4, 5, 4, 6, 5, 7, 6, 9, 8, 12, 11, 15])
const RANK = chart([3, 4, 6, 5, 8, 9, 8, 11, 13, 12, 14, 16])
const EVENTS = [
{ id: 'beta', date: '2025-06-12', title: 'Private beta opens', likes: '1,204' },
{ id: 'android', date: '2025-08-03', title: 'Lumen for Android', likes: '3,918' },
{ id: 'offline', date: '2025-10-14', title: 'Offline drafts', likes: '4,827' },
{ id: 'signups', date: '2025-11-20', title: 'Weekly signups double', likes: '6,175' },
{ id: 'spaces', date: '2026-01-09', title: 'Shared spaces', likes: '2,640' },
{ id: 'command', date: '2026-03-17', title: 'The command menu', likes: '5,302' },
{ id: 'rank', date: '2026-05-28', title: 'Top 10 in productivity', likes: '13,916' },
{ id: 'two', date: '2026-08-05', title: 'Lumen 2.0', likes: '27,130' },
]
const likes = (id: string) => EVENTS.find(event => event.id === id)?.likes
</script>
<template>
<div class="wrap">
<Timeline v-model="active" :events="EVENTS" label="Lumen release history">
<template #media="{ event }">
<svg v-if="event.id === 'signups' || event.id === 'rank'" viewBox="0 0 100 64" preserveAspectRatio="none" class="chart" role="img" aria-label="Rising line chart">
<path :d="(event.id === 'signups' ? SIGNUPS : RANK).area" class="area" />
<path :d="(event.id === 'signups' ? SIGNUPS : RANK).line" fill="none" stroke="currentColor" stroke-width="1.5" vector-effect="non-scaling-stroke" />
</svg>
<div v-else-if="event.id === 'android'" class="phone">
<div class="phone-body">
<div class="grip" />
<div class="bar b1" />
<div class="block" />
<div class="bar b2" />
<div class="bar b3" />
</div>
</div>
<div v-else-if="event.id === 'offline'" class="sync">
<div class="win">
<div class="dots"><span /><span /><span /></div>
<div class="line l1" />
<div class="line l2" />
<div class="line l3" />
</div>
<div class="side">
<div class="line l1" />
<div class="line l2" />
<div class="line l3" />
</div>
</div>
<div v-else-if="event.id === 'command'" class="keys">
<div class="kbds"><kbd>⌘</kbd><kbd>K</kbd></div>
<div class="line wide" />
</div>
<div v-else-if="event.id === 'two'" class="release"><span>2.0</span></div>
<div v-else class="grid">
<div v-for="i in 6" :key="i" class="tile" :style="{ opacity: 1 - (i - 1) * 0.1 }" />
</div>
</template>
<template #meta="{ event }">
<LucideIcon name="Heart" :size="16" />
<span>{{ likes(event.id) }}</span>
</template>
</Timeline>
</div>
</template>
<style scoped>
.wrap { width: 100%; padding: 1.5rem 0; box-sizing: border-box; }
.chart { width: 100%; height: 100%; color: var(--beui-foreground); }
.area { fill: color-mix(in srgb, var(--beui-foreground) 6%, transparent); }
.phone, .sync, .grid, .keys { --f15: color-mix(in srgb, var(--beui-foreground) 15%, transparent); --f10: color-mix(in srgb, var(--beui-foreground) 10%, transparent); --f06: color-mix(in srgb, var(--beui-foreground) 6%, transparent); --f20: color-mix(in srgb, var(--beui-foreground) 20%, transparent); background: color-mix(in srgb, var(--beui-muted) 40%, transparent); width: 100%; height: 100%; box-sizing: border-box; }
.phone { display: flex; align-items: flex-end; justify-content: center; padding-top: 1.25rem; }
.phone-body { display: flex; flex-direction: column; gap: .5rem; width: 50%; height: 100%; box-sizing: border-box; padding: .75rem; border: 1px solid var(--beui-border); border-bottom: 0; border-radius: 1.5rem 1.5rem 0 0; background: var(--beui-background); }
.grip { margin: 0 auto; width: 2rem; height: .375rem; border-radius: 9999px; background: var(--f15); }
.bar { height: .75rem; border-radius: 9999px; background: var(--f15); }
.phone .b1 { width: 66.6667%; }
.block { height: 4rem; border-radius: .75rem; background: var(--f06); }
.phone .b2, .phone .b3 { height: .5rem; background: var(--f10); }
.phone .b2 { width: 100%; }
.phone .b3 { width: 80%; }
.sync { display: flex; align-items: center; justify-content: center; gap: .75rem; padding: 1.25rem; }
.win { display: flex; flex: 1; flex-direction: column; gap: .5rem; height: 100%; box-sizing: border-box; padding: .75rem; border: 1px solid var(--beui-border); border-radius: .75rem; background: var(--beui-background); }
.side { display: flex; flex-direction: column; gap: .5rem; width: 25%; height: 80%; box-sizing: border-box; padding: .5rem; border: 1px solid var(--beui-border); border-radius: 1rem; background: var(--beui-background); }
.dots { display: flex; gap: .25rem; }
.dots span { width: .375rem; height: .375rem; border-radius: 9999px; background: var(--f20); }
.line { height: .5rem; border-radius: 9999px; background: var(--f10); }
.l1 { width: 75%; background: var(--f15); }
.l2 { width: 100%; }
.l3 { width: 66.6667%; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; padding: 1rem; }
.tile { border: 1px solid var(--beui-border); border-radius: .75rem; background: var(--beui-background); }
.keys { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; }
.kbds { display: flex; gap: .375rem; }
kbd { display: flex; width: 2.75rem; height: 2.75rem; align-items: center; justify-content: center; border: 1px solid var(--beui-border); border-radius: .75rem; background: var(--beui-background); font-family: var(--font-geist, ui-sans-serif, system-ui, sans-serif); font-size: 1.125rem; line-height: 1.75rem; color: var(--beui-foreground); box-shadow: 0 1px 2px 0 rgb(0 0 0 / .05); }
.line.wide { width: 7rem; }
.release { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; background: var(--beui-foreground); color: var(--beui-background); }
.release span { font-size: 3rem; line-height: 1; font-weight: 500; letter-spacing: -.05em; }
</style><script lang="ts">
/**
* A draggable, horizontally paged timeline: one event card is centered and at
* full size, its neighbours sit smaller and veiled beside it, tick groups mark
* the gaps and year numerals drift behind everything at half the track speed.
* Pointer drag, flick momentum, horizontal wheel, arrow keys, Home/End and a
* click on any card all move the track.
*/
export type TimelineEvent = {
/** Stable identity, used for `v-model` and list keys. */
id: string
/** ISO date string or Date. Read in UTC. */
date: string | Date
title: string
/** Footer line under the media: a stat, a tag, a reaction count. */
meta?: string
}
/** English defaults. Override per instance with `labels`. */
export const timelineMessages = {
label: 'Timeline',
hint: 'Use the left and right arrow keys to move between events.',
}
export type TimelineMessages = typeof timelineMessages
</script>
<script setup lang="ts">
import { animate, useMotionValue } from 'motion-v'
import { useReducedMotion } from '../core/reduced-motion'
import { computed, onBeforeUnmount, onMounted, onUpdated, shallowRef, useId, useSlots, useTemplateRef, watch } from 'vue'
import { capturePointer, releasePointer } from '../core/touch'
const props = withDefaults(defineProps<{
events: readonly TimelineEvent[]
/** Initially focused event id (uncontrolled). Defaults to the first event. */
defaultValue?: string
/** Card width in px at full size. Shrinks to fit narrow containers. */
itemWidth?: number
/** Stage height in px. */
height?: number
/** Large year numerals drifting behind the cards. */
years?: boolean
/** A group of ticks in each gap between cards. */
ruler?: boolean
/** Lines fanning from the top and bottom center to the cards near the center. */
cables?: boolean
formatDate?: (date: Date) => string
formatYear?: (date: Date) => string
/** BCP 47 tag for the card dates, mirroring the React `LocaleProvider`.
* Without one the labels stay English ("Mar 4 ’24"). */
locale?: string
/** Accessible name of the stage. */
label?: string
/** Override any built-in string. */
labels?: Partial<TimelineMessages>
className?: string
}>(), { itemWidth: 340, height: 600, years: true, ruler: true, cables: true })
const model = defineModel<string>()
const emit = defineEmits<{ valueChange: [id: string] }>()
const slots = useSlots()
defineSlots<{
media?(props: { event: TimelineEvent; index: number }): unknown
meta?(props: { event: TimelineEvent }): unknown
}>()
// Uncontrolled state lives in the model itself: `v-model` writes it from
// outside, and a plain `defaultValue` seeds the first frame.
const activeId = computed(() => model.value ?? props.defaultValue)
const t = computed(() => ({ ...timelineMessages, ...props.labels }))
const ariaLabel = computed(() => props.label ?? t.value.label)
// Timeline-specific: a release spring that takes the flick velocity, so the
// track coasts on past the finger and settles onto an event without a step.
const GLIDE_SPRING = { stiffness: 120, damping: 24, mass: 1 } as const
// Projected events per unit of release velocity (events/s), capped.
const FLICK_MOMENTUM = 0.3
const MAX_FLICK_EVENTS = 4
// Pointer travel before a press becomes a drag. Below it the press is a click.
const DRAG_THRESHOLD = 4
// Past either end the track follows the pointer at this fraction.
const RUBBER_BAND = 0.3
// Neighbours rest at this scale, veiled by SIDE_DIM; the focused event sits
// at full strength. The card is dimmed by a veil in the stage colour rather
// than by opacity, so it stays solid and nothing behind shows through it.
const SIDE_SCALE = 0.72
const SIDE_DIM = 0.45
// Year numerals drift at this fraction of the track speed, so they read as a
// far layer behind the cards.
const YEAR_PARALLAX = 0.5
// Gap above the year numerals, as a fraction of their font size.
const YEAR_INSET = 0.33
// Cards sit on the stage middle, between two equal bands: the top one holds
// the year numerals, and each holds the apex one fan of cables leaves from.
const CARD_CENTER = 0.5
// Each gap between cards holds a group of ticks: GAP_TICKS lines spread over
// GAP_TICK_SPAN of the gap, the middle one taller and brighter. Heights are
// fractions of the card width so the group scales with the cards.
const GAP_TICKS = 5
const GAP_TICK_SPAN = 0.7
const TICK_SHORT = 0.13
const TICK_TALL = 0.2
// Cables reach this far across a card's half-width, so they meet its top edge
// just inside the corners.
const CABLE_REACH = 0.8
// Only the centered card and its two neighbours carry cables: full strength
// out to CABLE_HOLD events from the center, gone by CABLE_FADE, so the fan
// stays at six lines however many events there are.
const CABLE_HOLD = 1
const CABLE_FADE = 1.6
// Horizontal wheel idle time before the track snaps to the nearest event.
const WHEEL_SETTLE = 140
const clamp = (value: number, min: number, max: number) => Math.min(max, Math.max(min, value))
const MONTH = new Intl.DateTimeFormat('en-US', { month: 'short', timeZone: 'UTC' })
const toDate = (date: string | Date) => (typeof date === 'string' ? new Date(date) : date)
const defaultFormatYear = (date: Date) => `’${String(date.getUTCFullYear()).slice(-2)}`
const defaultFormatDate = (date: Date) => `${MONTH.format(date)} ${date.getUTCDate()} ${defaultFormatYear(date)}`
const uid = useId()
const hintId = `${uid}-hint`
const reduce = useReducedMotion()
const count = computed(() => props.events.length)
const last = computed(() => Math.max(0, count.value - 1))
// Resolved during render: an unknown or removed id falls back to the first
// event, so there is always exactly one tab stop.
const activeIndex = computed(() => {
const found = props.events.findIndex(event => event.id === activeId.value)
return found === -1 ? 0 : found
})
const dates = computed(() => props.events.map(event => toDate(event.date)))
// Without a locale keep the English "Mar 4 ’24" so server and client match.
const formatDateLabel = computed<(date: Date) => string>(() => {
if (props.formatDate) return props.formatDate
if (!props.locale) return defaultFormatDate
const format = new Intl.DateTimeFormat(props.locale, {
day: 'numeric',
month: 'short',
year: '2-digit',
timeZone: 'UTC',
})
return (date: Date) => format.format(date)
})
const formatYearLabel = (date: Date) => props.formatYear?.(date) ?? defaultFormatYear(date)
// One numeral per year, centered on the boundary where that year begins.
const yearMarks = computed(() => {
const marks: { key: string; label: string; position: number }[] = []
let previous: number | null = null
dates.value.forEach((date, index) => {
const year = date.getUTCFullYear()
if (year === previous) return
previous = year
marks.push({ key: String(year), label: formatYearLabel(date), position: index === 0 ? 0 : index - 0.5 })
})
return marks
})
// --- Layout ---------------------------------------------------------------
const stage = useTemplateRef<HTMLElement>('stage')
const width = shallowRef(0)
let observer: ResizeObserver | undefined
const stageWidth = computed(() => width.value || 800)
// About a third of the stage at most, so each neighbour shows in full or
// nearly beside the focused card; phones give the card more of the width
// and keep a sliver of each neighbour.
const cardWidth = computed(() => Math.min(props.itemWidth, stageWidth.value * (stageWidth.value < 640 ? 0.58 : 0.36)))
// One gap everywhere: between the focused card and its neighbours, and
// between every pair of smaller cards further out. Wide enough to hold the
// tick group between cards.
const gap = computed(() => clamp(cardWidth.value * 0.22, 40, 72))
const step = computed(() => cardWidth.value * SIDE_SCALE + gap.value)
const near = computed(() => (cardWidth.value * (1 + SIDE_SCALE)) / 2 + gap.value)
const halfWidth = computed(() => stageWidth.value / 2)
const yearFontSize = computed(() => props.height * 0.2)
const yearTop = computed(() => yearFontSize.value * YEAR_INSET)
const tickGap = computed(() => (gap.value * GAP_TICK_SPAN) / (GAP_TICKS - 1) - 1)
const middleTick = (GAP_TICKS - 1) / 2
// --- Track position -------------------------------------------------------
// Track position in events (continuous); event i is centered at scroll = i.
const scroll = useMotionValue(activeIndex.value)
/** Card center relative to the stage center. Over the first step a card
* travels `near`, which leaves the same gap beside the bigger focused card
* as between the smaller cards further out, one `step` apart. */
function cardX(o: number) {
const a = Math.abs(o)
return Math.sign(o) * (a <= 1 ? a * near.value : near.value + (a - 1) * step.value)
}
function cardScale(o: number) {
return 1 - (1 - SIDE_SCALE) * Math.min(Math.abs(o), 1)
}
// Nearer the center paints on top, so a card arriving at the center slides
// over the one leaving mid-drag.
const cardZ = (o: number) => 100 - Math.round(Math.abs(o) * 10)
const cardVeil = (o: number) => SIDE_DIM * Math.min(Math.abs(o), 1)
function cableReach(o: number) {
return (cardWidth.value / 2) * cardScale(o) * CABLE_REACH
}
/** Left and right ends of one card's four cables: the near corners of the
* card, out from the stage center by the track offset. */
function cableEdges(o: number) {
const center = halfWidth.value + cardX(o)
const reach = cableReach(o)
return { left: center - reach, right: center + reach }
}
const cableOpacity = (o: number) => clamp((CABLE_FADE - Math.abs(o)) / (CABLE_FADE - CABLE_HOLD), 0, 1)
/** The tick group in the gap after card `index`. It sits midway between that
* card's right edge and the next card's left edge; the gap keeps one width
* while the cards move, so the group only translates. */
function tickX(index: number, s: number) {
const o = index - s
const right = cardX(o) + (cardWidth.value * cardScale(o)) / 2
const left = cardX(o + 1) - (cardWidth.value * cardScale(o + 1)) / 2
return (right + left) / 2
}
const yearX = (position: number, s: number) => (position - s) * step.value * YEAR_PARALLAX
// Values as rendered: the current track position is read when the component
// renders, so prerendered markup is already laid out before the first
// imperative paint.
const offsetAt = (index: number) => index - scroll.get()
const cableOpacityAt = (index: number) => cableOpacity(offsetAt(index))
const cableEdgesAt = (index: number) => cableEdges(offsetAt(index))
const yearXAt = (position: number) => yearX(position, scroll.get())
const tickXAt = (index: number) => tickX(index, scroll.get())
function cardStyle(index: number) {
const o = offsetAt(index)
return {
width: `${cardWidth.value}px`,
marginLeft: `${-cardWidth.value / 2}px`,
transform: `translateX(${cardX(o)}px) scale(${cardScale(o)})`,
zIndex: String(cardZ(o)),
'--veil-opacity': String(cardVeil(o)),
}
}
const hasMeta = (event: TimelineEvent) => Boolean(event.meta) || Boolean(slots.meta)
// --- Painted layers -------------------------------------------------------
// The track position is a MotionValue, so cards, numerals, ticks and cables
// follow it by writing straight to the DOM rather than re-rendering each
// frame. The layers are re-measured whenever a render may have changed them.
type Layers = {
cards: HTMLElement[]
years: { node: HTMLElement; position: number }[]
ticks: HTMLElement[]
cables: { group: SVGGElement; lines: SVGLineElement[] }[]
}
let layers: Layers | null = null
function measureLayers(): Layers | null {
const root = stage.value
if (!root) return null
return {
cards: Array.from(root.querySelectorAll<HTMLElement>('[data-slot="timeline-event"]')),
years: Array.from(root.querySelectorAll<HTMLElement>('[data-year-position]')).map(node => ({
node,
position: Number(node.dataset.yearPosition),
})),
ticks: Array.from(root.querySelectorAll<HTMLElement>('[data-ticks]')),
cables: Array.from(root.querySelectorAll<SVGGElement>('[data-cables]')).map(group => ({
group,
lines: Array.from(group.querySelectorAll('line')),
})),
}
}
function paint() {
if (!stage.value) return
const current = layers ?? (layers = measureLayers())
if (!current) return
const s = scroll.get()
current.cards.forEach((node, index) => {
const o = index - s
node.style.transform = `translateX(${cardX(o)}px) scale(${cardScale(o)})`
node.style.zIndex = String(cardZ(o))
node.style.setProperty('--veil-opacity', String(cardVeil(o)))
})
current.cables.forEach(({ group, lines }, index) => {
const o = index - s
const { left, right } = cableEdges(o)
group.style.opacity = String(cableOpacity(o))
lines[0]?.setAttribute('x2', String(left))
lines[1]?.setAttribute('x2', String(right))
lines[2]?.setAttribute('x2', String(left))
lines[3]?.setAttribute('x2', String(right))
})
for (const { node, position } of current.years) {
node.style.transform = `translateX(${yearX(position, s)}px)`
}
current.ticks.forEach((node, index) => {
node.style.transform = `translateX(${tickX(index, s)}px)`
})
}
// One paint per frame: a drag, a wheel burst and a glide all set the track
// value several times between frames, and only the last value is visible.
let paintQueued = false
function schedulePaint() {
if (paintQueued) return
paintQueued = true
queueMicrotask(() => {
paintQueued = false
paint()
})
}
function invalidateLayers() {
layers = null
}
function select(index: number, focus = false) {
const target = clamp(index, 0, last.value)
glideTo(target)
if (focus) focusButton(target)
}
function focusButton(index: number) {
const buttons = stage.value?.querySelectorAll<HTMLButtonElement>('.be-timeline-hit')
buttons?.[index]?.focus({ preventScroll: true })
}
// --- Moving the track -----------------------------------------------------
let glide: ReturnType<typeof animate> | null = null
// While a glide runs the target is already committed, so the track passing
// over the events in between must not hand focus back to them.
let gliding = false
let dragging = false
function stopGlide() {
gliding = false
glide?.stop()
glide = null
}
function commit(index: number) {
const event = props.events[index]
if (!event || index === activeIndex.value) return
model.value = event.id
emit('valueChange', event.id)
}
function glideTo(to: number, velocity = scroll.getVelocity()) {
stopGlide()
commit(to)
if (reduce.value) {
scroll.set(to)
return
}
gliding = true
glide = animate(scroll, to, {
type: 'spring',
...GLIDE_SPRING,
velocity,
restDelta: 0.001,
onComplete: () => {
gliding = false
glide = null
},
})
}
function settle(velocity: number) {
const projected = scroll.get() + clamp(velocity * FLICK_MOMENTUM, -MAX_FLICK_EVENTS, MAX_FLICK_EVENTS)
glideTo(clamp(Math.round(projected), 0, last.value), velocity)
}
function onCardKeyDown(event: KeyboardEvent, index: number) {
const next =
event.key === 'ArrowRight'
? index + 1
: event.key === 'ArrowLeft'
? index - 1
: event.key === 'Home'
? 0
: event.key === 'End'
? last.value
: null
if (next === null) return
event.preventDefault()
select(next, true)
}
// Under a drag or wheel, focus follows the event nearest the center.
const offScroll = scroll.on('change', value => {
if (!gliding) commit(clamp(Math.round(value), 0, last.value))
schedulePaint()
})
// Follow a value changed from outside (controlled), or a list that shrank.
watch([activeIndex, last], () => {
if (dragging || gliding) return
if (clamp(Math.round(scroll.get()), 0, last.value) === activeIndex.value) return
glideTo(activeIndex.value)
})
// --- Pointer gesture ------------------------------------------------------
const drag = {
id: -1,
startX: 0,
startScroll: 0,
moved: false,
lastX: 0,
lastT: 0,
prevX: 0,
prevT: 0,
}
function onPointerDown(event: PointerEvent) {
if (event.button !== 0) return
stopGlide()
const now = performance.now()
drag.id = event.pointerId
drag.startX = event.clientX
drag.startScroll = scroll.get()
drag.moved = false
drag.lastX = event.clientX
drag.lastT = now
drag.prevX = event.clientX
drag.prevT = now
dragging = true
}
function onPointerMove(event: PointerEvent) {
if (!dragging || event.pointerId !== drag.id) return
const dx = event.clientX - drag.startX
if (!drag.moved) {
if (Math.abs(dx) < DRAG_THRESHOLD) return
// Capture only once it is a drag, so a plain press still clicks the
// card under it; after a drag the click lands on the stage instead.
drag.moved = true
const element = event.currentTarget as Element | null
if (element) capturePointer(element, event.pointerId)
}
const raw = drag.startScroll - dx / step.value
scroll.set(
raw < 0
? raw * RUBBER_BAND
: raw > last.value
? last.value + (raw - last.value) * RUBBER_BAND
: raw,
)
drag.prevX = drag.lastX
drag.prevT = drag.lastT
drag.lastX = event.clientX
drag.lastT = performance.now()
}
function onPointerUp(event: PointerEvent) {
if (!dragging || event.pointerId !== drag.id) return
dragging = false
if (!drag.moved) return
const element = event.currentTarget as Element | null
if (element) releasePointer(element, event.pointerId)
const dt = drag.lastT - drag.prevT
const vpx = dt > 0 ? (drag.lastX - drag.prevX) / dt : 0 // px per ms
settle((-vpx * 1000) / step.value) // events per second
}
// Horizontal wheel and trackpad swipes move the track; vertical wheel is
// left to the page. Native listener: the browser's own back-swipe must be
// preventable, which a passive listener cannot do.
let settleTimer: ReturnType<typeof setTimeout> | undefined
function onWheel(event: WheelEvent) {
if (Math.abs(event.deltaX) <= Math.abs(event.deltaY)) return
event.preventDefault()
stopGlide()
scroll.set(clamp(scroll.get() + event.deltaX / step.value, -0.3, last.value + 0.3))
window.clearTimeout(settleTimer)
settleTimer = window.setTimeout(
() => glideTo(clamp(Math.round(scroll.get()), 0, last.value), 0),
WHEEL_SETTLE,
)
}
onMounted(() => {
const element = stage.value
if (!element) return
width.value = element.clientWidth
observer = new ResizeObserver(entries => {
width.value = entries[0]?.contentRect.width ?? element.clientWidth
})
observer.observe(element)
element.addEventListener('wheel', onWheel, { passive: false })
invalidateLayers()
paint()
})
// Any render can add, remove or resize a layer; re-measure, then repaint.
onUpdated(() => {
invalidateLayers()
paint()
})
onBeforeUnmount(() => {
offScroll()
stopGlide()
observer?.disconnect()
stage.value?.removeEventListener('wheel', onWheel)
window.clearTimeout(settleTimer)
layers = null
})
</script>
<template>
<section
ref="stage"
:aria-label="ariaLabel"
:aria-describedby="hintId"
:class="['be-timeline', className]"
:style="{ height: `${height}px` }"
@pointerdown="onPointerDown"
@pointermove="onPointerMove"
@pointerup="onPointerUp"
@pointercancel="onPointerUp"
>
<p :id="hintId" class="be-timeline-hint">{{ t.hint }}</p>
<template v-if="years">
<div
v-for="mark in yearMarks"
:key="mark.key"
:data-year-position="mark.position"
aria-hidden="true"
class="be-timeline-year"
:style="{ top: `${yearTop}px`, transform: `translateX(${yearXAt(mark.position)}px)` }"
>
<span class="be-timeline-year-label" :style="{ fontSize: `${yearFontSize}px` }">{{ mark.label }}</span>
</div>
</template>
<svg v-if="cables" aria-hidden="true" class="be-timeline-cables" fill="none" :stroke-width="1">
<g
v-for="(event, index) in events"
:key="event.id"
data-cables
:style="{ opacity: cableOpacityAt(index) }"
>
<line :x1="halfWidth" y1="0" :x2="cableEdgesAt(index).left" :y2="height * CARD_CENTER" />
<line :x1="halfWidth" y1="0" :x2="cableEdgesAt(index).right" :y2="height * CARD_CENTER" />
<line :x1="halfWidth" :y1="height" :x2="cableEdgesAt(index).left" :y2="height * CARD_CENTER" />
<line :x1="halfWidth" :y1="height" :x2="cableEdgesAt(index).right" :y2="height * CARD_CENTER" />
</g>
</svg>
<!-- The playhead: drawn over the cables so it reads as the line they hang
from, bright from end to end and fading only at the stage edges. -->
<div aria-hidden="true" class="be-timeline-playhead" />
<template v-if="ruler">
<div
v-for="(event, index) in events.slice(0, -1)"
:key="event.id"
data-ticks
aria-hidden="true"
class="be-timeline-ticks"
:style="{ top: `${CARD_CENTER * 100}%`, gap: `${tickGap}px`, transform: `translateX(${tickXAt(index)}px)` }"
>
<span
v-for="tick in GAP_TICKS"
:key="tick"
class="be-timeline-tick"
:data-middle="tick - 1 === middleTick || undefined"
:style="{ height: `${cardWidth * (tick - 1 === middleTick ? TICK_TALL : TICK_SHORT)}px` }"
/>
</div>
</template>
<ul class="be-timeline-list">
<li
v-for="(event, index) in events"
:key="event.id"
data-slot="timeline-event"
:data-active="index === activeIndex || undefined"
class="be-timeline-card"
:style="cardStyle(index)"
>
<!-- One solid surface holds the label, media and meta, so the cables
and ruler stop at its edge instead of showing through any part. -->
<div class="be-timeline-card-inner">
<div class="be-timeline-surface">
<div class="be-timeline-head">
<p :id="`${uid}-${index}-date`" class="be-timeline-date">{{ formatDateLabel(dates[index]!) }}</p>
<h3 :id="`${uid}-${index}-title`" class="be-timeline-title">{{ event.title }}</h3>
</div>
<div class="be-timeline-media">
<div class="be-timeline-media-frame">
<slot name="media" :event="event" :index="index" />
</div>
</div>
<div v-if="hasMeta(event)" class="be-timeline-meta">
<slot name="meta" :event="event">{{ event.meta }}</slot>
</div>
<div v-else class="be-timeline-meta-empty" />
<div aria-hidden="true" class="be-timeline-veil" />
</div>
<!-- Stretched over the whole card so the media stays valid content
outside the button and remains readable on its own. -->
<button
type="button"
:tabindex="index === activeIndex ? 0 : -1"
:aria-current="index === activeIndex ? 'step' : undefined"
:aria-labelledby="`${uid}-${index}-date ${uid}-${index}-title`"
class="be-timeline-hit"
@click="select(index)"
@keydown="event => onCardKeyDown(event, index)"
/>
</div>
</li>
</ul>
</section>
</template>
<style scoped>
/* clip-path rather than overflow: it also clips composited layers. The whole
stage fades at its edges together, so a card never turns see-through over
the cables behind it. */
.be-timeline {
position: relative;
width: 100%;
cursor: grab;
touch-action: pan-y;
overscroll-behavior-x: contain;
clip-path: inset(0);
mask-image: linear-gradient(to right, transparent, black 6%, black 94%, transparent);
user-select: none;
-webkit-user-select: none;
-webkit-touch-callout: none;
}
.be-timeline:active { cursor: grabbing; }
.be-timeline-hint {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
border: 0;
}
.be-timeline-year { position: absolute; left: 50%; }
.be-timeline-year-label {
display: block;
translate: -50% 0;
font-weight: 500;
line-height: 1;
letter-spacing: -0.05em;
font-variant-numeric: tabular-nums;
color: color-mix(in srgb, var(--beui-foreground) 6%, transparent);
}
.be-timeline-cables {
pointer-events: none;
position: absolute;
inset: 0;
width: 100%;
height: 100%;
stroke: color-mix(in srgb, var(--beui-foreground) 14%, transparent);
mask-image: linear-gradient(to bottom, transparent, black 6%, black 94%, transparent);
}
.be-timeline-playhead {
pointer-events: none;
position: absolute;
inset-block: 0;
left: 50%;
width: 1px;
translate: -50% 0;
color: color-mix(in srgb, var(--beui-foreground) 80%, transparent);
background-image: linear-gradient(to bottom, transparent, currentColor 6%, currentColor 94%, transparent);
}
.be-timeline-ticks {
position: absolute;
left: 50%;
display: flex;
align-items: center;
translate: -50% -50%;
}
.be-timeline-tick {
display: block;
width: 1px;
border-radius: 9999px;
background: color-mix(in srgb, var(--beui-foreground) 25%, transparent);
}
.be-timeline-tick[data-middle] { background: color-mix(in srgb, var(--beui-foreground) 45%, transparent); }
.be-timeline-list {
position: absolute;
inset: 0;
margin: 0;
padding: 0;
list-style: none;
}
.be-timeline-card { position: absolute; left: 50%; top: 50%; }
.be-timeline-card-inner { position: relative; translate: 0 -50%; }
.be-timeline-surface {
position: relative;
overflow: hidden;
border: 1px solid var(--beui-border);
border-radius: 1.5rem;
background: var(--beui-card);
}
.be-timeline-head { padding: 0.75rem 0.875rem 0.5rem; }
.be-timeline-date {
margin: 0;
font-size: 0.75rem;
line-height: 1rem;
color: var(--beui-muted-foreground);
font-variant-numeric: tabular-nums;
}
.be-timeline-title {
margin: 0;
padding: 0;
border: 0;
overflow: hidden;
font-size: 1rem;
font-weight: 500;
line-height: 1.5rem;
letter-spacing: -0.025em;
text-overflow: ellipsis;
white-space: nowrap;
color: var(--beui-foreground);
}
.be-timeline-media { padding: 0 0.5rem; }
.be-timeline-media-frame {
aspect-ratio: 16 / 10;
overflow: hidden;
border: 1px solid var(--beui-border);
border-radius: 1rem;
background: var(--beui-background);
}
.be-timeline-meta {
display: flex;
align-items: center;
gap: 0.375rem;
padding: 0.625rem 0.875rem;
font-size: 0.875rem;
line-height: 1.25rem;
color: var(--beui-muted-foreground);
font-variant-numeric: tabular-nums;
}
.be-timeline-meta-empty { height: 0.5rem; }
.be-timeline-veil {
pointer-events: none;
position: absolute;
inset: 0;
background: var(--beui-background);
opacity: var(--veil-opacity, 0);
}
.be-timeline-hit {
position: absolute;
inset: 0;
padding: 0;
border: 0;
border-radius: 1.5rem;
background: transparent;
cursor: pointer;
outline: none;
}
.be-timeline-hit:focus-visible { box-shadow: 0 0 0 2px var(--beui-foreground); }
</style>Install
Add it with your package manager, or copy the source manually.
Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide
$ bunx --bun shadcn-vue@latest add @beui-vue/timeline$ bun add beui-vueDownload the release archive to your project root, then install the local file.
$ bun add ./beui-vue-0.1.0.tgzImport the shared styles once in your application.
import Timeline from '@/components/beui/layout/Timeline.vue'
import '@/components/beui/styles.css'API Reference
eventsreadonly TimelineEvent[]—v-model?stringFocused event id (controlled).
—defaultValue?stringInitially focused event id (uncontrolled). Defaults to the first event.
—@value-change?(id: string) => void—itemWidth?numberCard width in px at full size. Shrinks to fit narrow containers.
340height?numberStage height in px.
600years?booleanLarge year numerals drifting behind the cards.
trueruler?booleanA group of ticks in each gap between cards.
truecables?booleanLines fanning from the top and bottom center to the cards near the center.
trueformatDate?(date: Date) => string—formatYear?(date: Date) => string—aria-label?string—labels?Partial<TimelineMessages>Override any built-in string.
—className?string—locale?stringBCP 47 tag for the card dates, mirroring the React `LocaleProvider`. Without one the labels stay English ("Mar 4 ’24").
—label?stringAccessible name of the stage.
—#media?{ event: TimelineEvent; index: number }—#meta?{ event: TimelineEvent }—Used in these Pro blocks
Related components
Arc Picker
Radial text picker with top, bottom, left or right curves, smooth wheel movement and live selection on each scroll step. One persistent bracket frame grows and squeezes around each label. Supports drag momentum, keyboard input, disabled choices, controlled or uncontrolled values, forms and reduced motion.
Card
Composable card with header, title, description, action, content and footer parts. Outlined or muted surfaces, standard or compact spacing, and an opt-in selectable state with press feedback that composes with Checkbox, Radio and Button.
Tilt Card
3D perspective tilt on hover with cursor-tracked glare.
Updated