Props

Methods

Reference

Props

initialPage

Index of initial page that should be selected. Use setPage method to update the page, and onPageSelected to monitor page changes

Type

Required

number

No

keyboardDismissMode

Determines whether the keyboard gets dismissed in response to a drag.

'none' (the default), drags do not dismiss the keyboard.

'on-drag', the keyboard is dismissed when a drag begins.

Type

Required

enum('none', 'on-drag')

No

onPageScroll

Executed when transitioning between pages (ether because of animation for the requested page change or when user is swiping/dragging between pages) The event.nativeEvent object for this callback will carry following data:

position - index of first page from the left that is currently visible

offset - value from range [0,1) describing stage between page transitions. Value x means that (1 - x) fraction of the page at "position" index is visible, and x fraction of the next page is visible.

Type

Required

function

No

onPageSelected

This callback will be caleld once ViewPager finish navigating to selected page (when user swipes between pages). The event.nativeEvent object passed to this callback will have following fields: