Components
← All components

Intersection

stimeo--intersection

The groundwork that turns an element entering and leaving the screen into events and CSS values.

  • Core

Watches whether an element is on screen and reports what changes. Anything triggered by scrolling is built on top of it: endless lists, numbers counting up, a reading bar, a header that gets out of the way. Becoming visible, leaving, and fully passing the top edge are each reported, and leaving says whether it went up or down. How much of it is visible is readable from CSS, so smoothly moving effects are easy to write, and so is whether it is visible at all, which is how everything in this demo is drawn with CSS alone. After you add content, the current state can be delivered again as a fresh change.

running

Scroll inside the frame. The box reacts to its own visibility with CSS alone: the border and label come from the visible state, and the bar from how much of it is showing.

Scroll down…

Visible Not visible yet Scrolled past

…and back up.

Keyboard

This component has no keyboard interactions of its own.