---
title: "How do you add infinite scroll to an Ionic list?"
description: "Add ion-infinite-scroll below an ion-list, load the next page in the ionInfinite handler, and complete the event or disable the control when no data is left."
url: "https://bugsee.com/answers/ionic/ionic-infinite-scroll/"
---

# How do you add infinite scroll to an Ionic list?

Place `<ion-infinite-scroll>` after the list, load the next page in its `ionInfinite` handler, then call `complete()` on the event target, and disable it when there is no more data.

```html
<ion-content>
  <ion-list>
    <ion-item *ngFor="let item of items">{{ item }}</ion-item>
  </ion-list>

  <ion-infinite-scroll threshold="100px" (ionInfinite)="loadMore($event)">
    <ion-infinite-scroll-content loadingText="Loading more…"></ion-infinite-scroll-content>
  </ion-infinite-scroll>
</ion-content>
```

```typescript
import { InfiniteScrollCustomEvent } from '@ionic/angular';

items: string[] = [];
page = 0;

async loadMore(event: InfiniteScrollCustomEvent) {
  const next = await this.api.getPage(++this.page);   // your data source
  this.items.push(...next);

  event.target.complete();
  if (next.length === 0) {
    event.target.disabled = true;                      // nothing left to load
  }
}
```

Always call `complete()`, even after an error, or the control will not fire again. Load the first page yourself, since infinite scroll only triggers when the user scrolls near the end.

## Related questions

- [How do you lazy load images in Angular and Ionic?](https://bugsee.com/answers/ionic/angular-lazy-load-images/)
