0.0.1 • Published 5 years ago

react-native-dw-carousel v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Carousel

Description

A carousel container component.

Props

NameTypeRequiredDefault valueDescription
Carousel.PageReact.Nodetrue-A component that will be rendered the pages Carousel
childrenReact.NodefalsenullA component that will be rendered inside the Carousel.Page.
initialPageIntegerfalse0Set a initial page
hideIndicatorsBooleanfalsefalseSet to true to hide the indicators
indicatorColorStringfalse#FFFFFFActive indicator color
indicatorSizeFloatfalse30Indicator bullet size
indicatorSpaceFloatfalse15Space between each indicator
inactiveIndicatorColorStringfalse#DDDDDDInactive indicator color
indicatorAtBottomBooleanfalsetrueSet to false to show the indicators at the top
indicatorOffsetFloatfalse0Indicator relative position from top or bottom
inactiveIndicatorTextStringfalse'•'Inactive indicator content ( You can customize to use any Unicode character )
indicatorTextStringfalse'•'Active indicator content ( You can customize to use any Unicode character )
animateBooleanfalsefalseEnable Carousel autoplay
delayIntegerfalse1000Set Animation delay between slides
loopBooleanfalsefalseAllow infinite looped animation. Depends on Prop {...animate} set to true.
containerStyleTStylefalse{}Style container - component Carousel
pageStyleTStylefalse{}Style container - component Carousel.Page

Usage example

  import Carousel from 'react-native-dw-tooltip'
  ...

  render() {
    ...
    return (
      <Carousel
        indicatorColor="red"
      >
        <Carousel.Page>
          <View>
            <Text>Content 1 - Page 1</Text>
          </View>
          <View>
            <Text>Content 2 - Page 1</Text>
          </View>
        </Carousel.Page>
        <Carousel.Page>
          <View>
            <Text>Content 1 - Page 2</Text>
          </View>
          <View>
            <Text>Content 2 - Page 2</Text>
          </View>
        </Carousel.Page>
      </Carousel>
    )
  ...