Load more
ProThe end of a list loaded a page at a time: loads as the end comes near, with Load more, a loading state and Retry. Not an M3 component (@windmorph/react-pro).
import { LoadMore } from '@windmorph/react-pro';Part of Windmorph Pro, paid components on the free core, not on sale yet. See the Pro guide for what it includes and to register interest.
Purpose
The end of a list that loads a page at a time: it loads the next page as the end comes near, with Load more as the keyboard and screen-reader fallback, shows what the app wants while loading, and offers Retry when a page fails. It is not an M3 component, so it comes from @windmorph/react-pro.
Behaviour
statusis the app's:idle,loading,errorordone.- With
autoit callsonLoadMoreonce per idle state as the end comes withinrootMargin(800px) of the viewport. Without it (the default), only the button loads more. A list in its own scrolling box leavesautooff, as in the first example, since the end is measured against the viewport. - It never retries by itself after a failure, so a failing page isn't requested in a loop.
loadingIndicatorreplaces the default loading indicator (e.g. a skeleton of one item);endMessageshows once everything is loaded.- Focus never drops to the page: while focus is inside it (after a press on Load more or Retry, or on Load more as it loads by itself), it holds focus on its root while the page loads, then on the next Load more or Retry, without scrolling the page.
- It opts out of the browser's scroll anchoring (
overflow-anchor: none), so a new page goes in below what's on screen instead of moving the page by its whole height. - A failure is announced through a live region that's in the page from the start.
When not to use
For numbered pages people jump between, use pagination.
See also
- Loading indicator: An Expressive shape that morphs while it rotates; replaces the spinning circle.
- Skeleton: A placeholder in the shape of loading content, pure CSS with pulse or shimmer. Not an M3 component (@windmorph/react-pro).
- List: Rows with headline, overline, supporting text and leading or trailing content (icons, avatars, images, video thumbnails); items can be links, switches, checkboxes or radio buttons, and put in order by drag or a menu.