What is infinite scroll?
Infinite scroll loads the next batch of items automatically when the user nears the bottom of a list. There’s no “Next” button: scrolling is the action. You know it from social feeds, photo streams, news apps, shop categories and search results in many apps.
It’s still pagination underneath. The app asks the server for a page of items (say 20), shows them, and asks for the next page when it’s needed. The difference is only who decides when: the scroll position, not a tap.
Anatomy
One list, three possible bottoms: loading, error or the end
- 1
Loaded items
Everything fetched so far. Each request adds one more page (often 10–30 items).
- 2
Viewport
What the user sees right now. Everything else is above or below it.
- 3
Prefetch distance
How early the next page starts loading, e.g. one screen before the end, so people rarely wait.
- 4
Sentinel
An invisible marker after the last item. When it comes close to the viewport, the next page is requested.
- 5
Loading row
A small spinner at the bottom while the next page loads. Must disappear on success, error and at the end.
- 6
Error row
“Couldn’t load more. Retry” right where the next items would be, without losing the loaded ones.
- 7
End of list
“You’ve seen all 120 results.” Stops the spinner and makes the footer reachable.
How it works
- A sentinel marks the end. After the last loaded item sits an invisible element, the sentinel.
Dev note
On the web, anIntersectionObserverwatches it; on iOS and Android, the list reports when its last rows are about to appear (prefetchDataSourceorwillDisplayin UIKit,.onAppearon the last row in SwiftUI, the Paging library on Android). - The prefetch distance decides how early. The observer can fire before the sentinel is visible, e.g. one screen ahead. Too small, and people stare at a spinner at the bottom. Too large, and the app loads pages nobody will see.
Dev note
On the web:rootMargin: "0px 0px 800px 0px". - One request asks for the next page. Feeds usually use cursor paginationCursor paginationFetching the next items after a given item instead of skipping a count of items.Open in glossary →: “20 items after item r40” (
?limit=20&after=r40), instead of “skip 40, take 20”. The response contains the items and the cursor for the next page, ornullwhen there’s nothing more. - The app appends and waits. New items are added at the bottom, the sentinel moves down with them, and nothing happens until it comes close again. While a request is running, the app must not start another one.
- The list ends, or fails, clearly. When the next cursor is
null, the app stops loading and says so. When a request fails, it shows an error row with Retry, right where the new items would have appeared.
The page size matters too: 10–30 items is typical. Tiny pages mean many requests and frequent waits; huge pages mean slow responses and lots of memory on cheap phones.
How it differs from similar patterns
| Pattern | What triggers loading | Typical use |
|---|---|---|
| Infinite scroll | Reaching the end of the list | Feeds, photo streams, browsing |
| “Load more” button | A tap or click | Shop lists, search results, comments |
| Numbered pagination | Choosing a page | Shops, tables, results people come back to |
| Pull to refresh | Pulling down at the top | Loading newer items at the top |
| lazy loadingLazy loadingLoading images or content only when the user scrolls near them.Open in glossary → (images) | An image nearing the viewportViewportThe visible area of a web page in the browser window or on the device screen.Open in glossary → | Saving data on long pages; the items already exist |
| Virtualization | Not loading at all: rendering only visible rows | Keeping long lists fast in memory |
Designs & variants
- Endless feed (list): one column of posts or articles, newest first. Social apps, news.
- Product or photo grid: two to four columns. Each page fills whole rows, or the last row looks broken.
- Reverse list (chat): older messages load at the top when you scroll up, and the list must keep your place while they’re inserted above you.
- Hybrid “load more”: the first two or three pages load on scroll, then a Load more button appears. It keeps the footer reachable and gives keyboard users a stop.
- With helpers: a “Back to top” button after a long scroll, a “New posts” pill when fresh items wait above, or a result count (“312 results”).
Try it: scroll lab
A correct infinite scroll on a recipes feed. The red dashed line is the sentinel, the blue one shows where loading starts. Play with the settings and watch the counters and the network log:
- Scroll to the bottom with prefetch 0 px (you wait for the spinner), then with 1 screen (you rarely see it).
- Switch the network to Fails, scroll down, then back to Fast and tap Retry. Nothing loads on its own after an error until you retry.
- Use 45 recipes to reach the end and the footer. Use 1,000, load a few pages and turn on Virtualize: the rows in the DOM drop to a handful.
- Open a recipe far down the list and go Back. Try Load more button mode with the keyboard.
Recipes
0 of 45 loaded
Prefetch distance
With a slow network, 0 px means waiting at the bottom; 1 screen loads before you get there.
Page size
Items per request: see limit= in the log.
Network
Catalog size
Restarts the feed. 45 reaches the end quickly.
Loading
Virtualize rows
Watch “Rows in the DOM” below, best with 1,000 and a few loads.
Debug overlay
Loaded
0
Rows in the DOM
0
Sentinel distance
0 px
Network log
Try: scroll to the bottom with “0 px” and then with “1 screen”. Switch the network to Fails, then back to Fast and tap Retry. Open a recipe far down and go Back.
Check this part
What usually triggers loading the next page in infinite scroll?
What happens if the prefetch distance is too small?