Skip to content

Instantly share code, notes, and snippets.

@garrettmac
Created September 20, 2017 00:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garrettmac/bccb7cd2fc02162a2964e9380d750f6b to your computer and use it in GitHub Desktop.
Save garrettmac/bccb7cd2fc02162a2964e9380d750f6b to your computer and use it in GitHub Desktop.
a
@garrettmac
Copy link
Author

<Pagination
dotThemeLight //<--use with backgroundColor:"grey"
listRef={this.refs}//to allow React Native Pagination to scroll to item when clicked (so add "ref={r=>this.refs=r}" to your list)
paginationVisibleItems={this.state.viewableItems}//needs to track what the user sees
paginationItems={this.state.items}//pass the same list as data
paginationItemPadSize={3} //num of items to pad above and below your visable items
more params you can play with
hideEmptyDots
pagingEnabled
dotSwapAxis
dotPositionSwap
disableDotOnPressNavigation
dotOnPress={(item)=>alert(JSON.stringify(item))}
startDotOnPress={(item)=>alert("pressed startDotOnPress")}
endDotOnPress={(item)=>alert("pressed endDotOnPress")}
startDotIconFamily="Ionicons"
startDotIconName="ios-arrow-back"
endDotIconFamily="Ionicons"
endDotIconName="ios-arrow-forward"
dotIconNameActive={"contacts"}
dotTextColor={"red"}
dotTextColorActive={"green"}
dotTextColorNotActive={"red"}
dotTextColorEmpty={"blue"}
dotIconColorActive={"green"}
dotIconColorNotActive={"red"}
dotIconColorEmpty={"blue"}
/>

@garrettmac
Copy link
Author

iconFamily -> iconSet
hideEmptyDots -> showEmptyDots
dotThemeLight => lightTheme
paginationContainerStyle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment