Data display
Layout
Timeline
An ordered list of steps joined by a line, where each step can hold any content. Use it for a history, an order’s progress or a changelog.
Install
import { Timeline } from 'vael-ui'Playground
- Mon
Design
- Tue
Build
- Wed
Review
- Thu
Ship
vertical
import { Timeline } from 'vael-ui'
<Timeline
:items="steps"
orientation="vertical"
:motion="true"
:current="current"
>
<template #opposite="{ item }">{{ item.date }}</template>
<template #item="{ item }">{{ item.label }}</template>
</Timeline>Motion New
Timeline's steps: values or hooks for item and its parts (connector is missing on the last step, previousConnector on the first, opposite without the slot), stagger and leaving.
<Timeline
:motion="{ initial: { item: { opacity: 0, y: 8 } }, stagger: 0.04 }"
/>| Name | Type | Description |
|---|---|---|
initialexit | itemmarkerconnectorpreviousConnectorcontentopposite | Sets where each part comes in from and leaves to: any CSS property, plus x, y and blur. A plain number is px, or degrees for rotate. |
enterleave | (parts, context) => animation | Animates the parts with GSAP, motion or element.animate(). Return the animation and the component waits for it, and stops it if interrupted. |
staggerleavingappear | number | 'pop' | 'hold' | boolean | Items coming in together start stagger seconds apart. A leaving item lifts out so the rest close the gap ('pop'), or keeps its space until it's gone ('hold'). appear: true also brings in the items already there when it mounts. |
springdurationeasing | { damping, response } | number | string | Times all of it: a spring, or a duration in ms with an easing. Never both. |
false | boolean | Turns its motion off, for an animation of your own on its exposed elements. |
Accessibility
It has no keyboard interaction of its own.
- Timeline renders an
<ol>with one<li>per item, so screen readers announce a list and its length. - The marker, including your
#markerslot, and the connector arearia-hidden. activesetsaria-current="step"on its item.completedsets only adata-attribute, so put that state in the item text when it matters.- A timeline that overflows with nothing focusable inside becomes a Tab stop, so you can scroll it with the keyboard.