Carousel

Carousel for scrolling pages horizontally.

PropTypes

Prop Type Description
initialPage number Initial page when the carousel is loaded. Default 0
pageWidth number Width of each carousel page item. Default device-width.
onChangePage function Function to call when carousel page changes.
containerStyle object, number or array Additional styles to apply to carousel.

Usage

import {Colors, View, Carousel, PageControl} from 'react-native-ui-lib';

<View flex>
  <Carousel onChangePage={currentPage => this.setState({currentPage})} 
    initialPage={this.state.currentPage}>
    <View> ... </View>
    ...
  </Carousel>
  <PageControl
    numOfPages={8}
    currentPage={this.state.currentPage}
    color={Colors.dark10}
    size={15}
  />  
</View>

results matching ""

    No results matching ""