0.0.1 • Published 5 years ago

dwcarousel v0.0.1

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

DWcarousel

Description

A carrosel container component.

Props

NameTypeRequiredDefault valueDescription
DWcarousel.PageReact.Nodetrue-A component that will be rendered the pages DWcarousel
childrenReact.NodefalsenullA component that will be rendered inside the DWcarousel.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 BBCarrosel
pageStyleTStylefalse{}Style container - component DWcarousel.Page

Usage example

  ...

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