Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/uniplaces/react-native-uni-carousel
https://github.com/uniplaces/react-native-uni-carousel
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/uniplaces/react-native-uni-carousel
- Owner: uniplaces
- Created: 2017-10-12T10:37:12.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-12T18:44:53.000Z (over 6 years ago)
- Last Synced: 2024-12-01T07:40:03.363Z (27 days ago)
- Language: JavaScript
- Size: 120 KB
- Stars: 5
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React Native Uni Carousel
This small package is based on FlatList. It provides components to help create both a horizontal list of items and a paginated horizontal list of items.
## Usage
### CardList
Simple FlatList card with some helper methods
```
(
// render of each item
)}
cards={[{ name: 'item1' }, { name: 'item2' }]}
options={options}
/>
```#### Props
**spaceBetweenCards** - Margin between cards
**selectedIndex** - Item that is selected on the list
**onChangeSelected** - Callback called when the selectedItem changes
**unselectedCardsWidth** - Space from the next and previous card that is shown
**render(itemToRender, CardListContainerProps)** - Render callback of every single item
**cards** - The array of items to render
**options** - Object of props that get directly passed to `FlatList`
### PaginatedCardList
Just a wrapper around `CardList` that handles the pagination and provides some callbacks to track page changes
```
```#### Props
**pages** - Object with keys as numbers (`{1: [page 1 array of items], 2: [page 2 array of items]}`
**onChangePage** - Callback that gets called on page change