# Customizing page navigation in our React Native PDF viewer

After loading a PDF document in Nutrient, you can programmatically interact with it (e.g. scrolling to different pages). All the interaction APIs are available on the [`NotificationCenter`][notificationcenter].

## Changing the current page

A user can change the current page in the UI by swiping on a device. Pages can also be programmatically changed using the `pageIndex` prop, like so:

```js

<NutrientView
	document={DOCUMENT}
	// Navigate to the page index at index 4.
	pageIndex={4}
	ref={this.pdfRef}
	fragmentTag="PDF1"
	style={{ flex: 1 }}
/>

```

or by calling the `setPageIndex` method on the `PDFDocument` instance:

```js

await this.pdfRef?.current?.getDocument().setPageIndex(4);

```

## Getting the current page

To get the currently visible page index, you need to listen to the `NotificationCenter.DocumentEvent.PAGE_CHANGED` event, like so:

```js

<NutrientView
  document={DOCUMENT}
  ref={this.pdfRef}
  fragmentTag="PDF1"
  style={{flex: 1}}
  // Register for the `PAGE_CHANGED` event.
  onReady={() => {
    this.pdfRef.current?.getNotificationCenter().subscribe(NotificationCenter.DocumentEvent.PAGE_CHANGED, (payload: NotificationCenter.DocumentPageChangedPayload) => {
      console.log(payload);
    });
  }}
/>

```
---

## Related pages

- [React Native PDF viewer library](/guides/react-native/viewer.md)
- [React Native image viewer library](/guides/react-native/viewer/images.md)
- [Rotating pages in our React Native PDF viewer](/guides/react-native/viewer/page-rotation.md)
- [Configuring scroll direction and page transitions in our React Native viewer](/guides/react-native/viewer/page-transition.md)
- [React Native PDF reader library](/guides/react-native/viewer/reader-view.md)

