Skip to content

Timeline axis & inset

Axis

Pick which axis of the scroller drives the timeline.

ClassCSS
view-timeline-axis-xview-timeline-axis: x
view-timeline-axis-yview-timeline-axis: y
view-timeline-axis-blockview-timeline-axis: block
view-timeline-axis-inlineview-timeline-axis: inline
scroll-timeline-axis-xscroll-timeline-axis: x
scroll-timeline-axis-yscroll-timeline-axis: y
scroll-timeline-axis-blockscroll-timeline-axis: block
scroll-timeline-axis-inlinescroll-timeline-axis: inline

block and inline follow the document's writing mode. Use them when you want the behavior to flip automatically for RTL or vertical writing.

Inset

Shrink (or pad out) the active region of a view timeline.

ClassCSS
view-timeline-inset-[<value>]view-timeline-inset: <value>

Accepts any valid CSS length, percentage, or pair. Underscores become spaces inside arbitrary values.

html
<!-- start tracking 10% before the element enters, stop 20% before it leaves -->
<div class="view-timeline-hero view-timeline-inset-[10%_20%]" />

Released under the MIT License.