Magoo Component UI logo Magoo Component UI
← Catalog

Infinite Scroll Sentinel

infinite-scroll-sentinel atom experimental

A load-more trigger that dispatches a loadmore event when it scrolls into view, with a spinner and an end-of-list state.

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default
Loading more…
Done
You have reached the end

Props

NameTypeReq
label string
done boolean

Related components

How to use

behavior.js attaches an IntersectionObserver to the sentinel with a 200px rootMargin, so it fires a little before the element is fully visible. Each time it enters view and data-done is not "true" it dispatches a bubbling "loadmore" CustomEvent; the parent handles the fetch and, when the list is exhausted, updates the done prop so the observer stops triggering. The observer is disconnected on cleanup. The spinner uses motion-safe:animate-spin so it is still for users who prefer reduced motion.

Use cases

list-itembanner WCAG AA SEO 20 dir: both ai-generated