0.4.0 • Published 4 months ago

react-native-flash-carousel v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

react-native-flash-carousel

Carousel component for React Native powered by FlashList

Animation

Installation

yarn add @shopify/flash-list
yarn add react-native-flash-carousel

Usage

Only 2 props are required: data and renderItem

import { Carousel } from 'react-native-flash-carousel'

// ...

export const AwesomeApp = () => (
  <Carousel
    data={yourData}
    renderItem={({ item }) => <Card item={item} />}
  />
)

Props

PropDescriptionTypeDefault
dataRequiredFlashList doc
renderItemRequiredFlashList doc
autoScrollEnables auto scrolling of the carouselbooleanfalse
autoScrollIntervalOnly works when auto scroll is enabled. Scroll interval in seconds.number5
autoScrollPauseOnly works when auto scroll is enabled. The interval after which auto scroll starts working again after the user has interacted with the carouselnumber5
paginationDisplays the pagination component below the carouselbooleanfalse
paginationDotStyleStyles for dots in the pagination componentPaginationDotStylePaginationDotStyle

Supports FlashList's props for horizontal list FlashList docs

Types

interface PaginationDotStyle {
  dotColor?: string        // default 'lightgray'
  activeDotColor?: string  // default 'darkgray'
  dotSize?: number         // default 8
  activeDotSize?: number   // default 9
}

Roadmap

Will be dynamically updated

  • v0.2 Carousel component
  • v0.3 Auto scroll feature
  • v0.4 Pagination component
  • Looping feature
  • Analytics feature
  • Different types of swiping feature
  • ...

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library