New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-native-uni-carousel

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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.

latest
npmnpm
Version
0.2.10
Version published
Maintainers
2
Created
Source

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

  <CardList
    // Same as item width
    spaceBetweenCards={marginBetweenCards * 2}
    // Same as item margin
    unselectedCardsWidth={otherCardsWidth}
    render={({ item, index }, { width }) => (
      // 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

  <PaginatedCardList
    // Same props as CardList (they get passed down to CardList, except cards)
    pages={pages}
    onChangePage={onChangePage}
  />

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

Keywords

react-native

FAQs

Package last updated on 12 Apr 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts