All Projects → meinto → react-native-viewpager-carousel

meinto / react-native-viewpager-carousel

Licence: MIT license
a flexible viewpager library with carousel functionality

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-native-viewpager-carousel

React Native Tab View
A cross-platform Tab View component for React Native
Stars: ✭ 4,742 (+12058.97%)
Mutual labels:  tabs, swipe, tabbar, swipeview, pager-component
Discretescrollview
A scrollable list of items that centers the current element and provides easy-to-use APIs for cool item animations.
Stars: ✭ 5,533 (+14087.18%)
Mutual labels:  carousel, swipe, viewpager
IndicatorView
IndicatorView Library For Android
Stars: ✭ 41 (+5.13%)
Mutual labels:  carousel, tabs, viewpager
React Native Head Tab View
Add collapsible headers to your tab-view components.
Stars: ✭ 171 (+338.46%)
Mutual labels:  tabs, swipe, tabbar
Hibiscus.js
Native Angular directives for Bootstrap4
Stars: ✭ 115 (+194.87%)
Mutual labels:  carousel, tabs
React Soft Slider
Simple, fast and impartial slider
Stars: ✭ 54 (+38.46%)
Mutual labels:  carousel, swipe
carousel-viewpager
Beautiful carousel layout implemented using ViewPager
Stars: ✭ 17 (-56.41%)
Mutual labels:  carousel, viewpager
Slider
Touch swipe image slider/slideshow/gallery/carousel/banner mobile responsive bootstrap
Stars: ✭ 2,046 (+5146.15%)
Mutual labels:  carousel, swipe
React Touch Carousel
Ultra-customizable carousel framework for React.JS
Stars: ✭ 158 (+305.13%)
Mutual labels:  carousel, swipe
React Native Swiper Flatlist
👆 Swiper component implemented with FlatList using Hooks & Typescript + strict automation tests with Detox
Stars: ✭ 217 (+456.41%)
Mutual labels:  carousel, swipe
vue-product-carousel
Simple product carousel with hot image replacement, Zoom and Swipe mode
Stars: ✭ 37 (-5.13%)
Mutual labels:  carousel, swipe
Ng Bootstrap
Angular powered Bootstrap
Stars: ✭ 7,872 (+20084.62%)
Mutual labels:  carousel, tabs
Splide
Splide is a lightweight, powerful and flexible slider and carousel, written in pure JavaScript without any dependencies.
Stars: ✭ 786 (+1915.38%)
Mutual labels:  carousel, swipe
React Responsive Carousel
React.js Responsive Carousel (with Swipe)
Stars: ✭ 1,962 (+4930.77%)
Mutual labels:  carousel, swipe
Swiper
Most modern mobile touch slider with hardware accelerated transitions
Stars: ✭ 29,519 (+75589.74%)
Mutual labels:  carousel, swipe
Cardslider
Card Slider is an android component allows you to implement carousel effect with infinite indicators and more features
Stars: ✭ 160 (+310.26%)
Mutual labels:  carousel, viewpager
MetalRecyclerPagerView
RecyclerView implementation for Android which makes it look and feel like ViewPager with item margins support (mutliple views effect).
Stars: ✭ 26 (-33.33%)
Mutual labels:  swipe, viewpager
Material-BottomBarLayout
🎉A material navigation bar library which has pretty animations and different ways of arrangement.
Stars: ✭ 56 (+43.59%)
Mutual labels:  tabs, viewpager
tiny-wheels
一套基于原生JavaScript开发的组件库,无依赖、体积小、简单易用
Stars: ✭ 60 (+53.85%)
Mutual labels:  carousel, tabs
Vue Picture Swipe
🖼 Vue Picture Swipe Gallery (a gallery of image with thumbnails, lazy-load and swipe) backed by photoswipe
Stars: ✭ 322 (+725.64%)
Mutual labels:  carousel, swipe

React Native Viewpager Carousel

npm version dependencie status dev-dependency status npm npm travis build

Contribution

Feel free to make a pull request. I'm happy about every contribution.

Examples

You can find example implementations for all use cases of this library in the repo react-native-viewpager-carousel-example-app. The example project is also linked as git submodule in this project.

Installation

yarn add react-native-viewpager-carousel

or

npm install --save react-native-viewpager-carousel

Preview

preview

ViewPager

The <ViewPager /> is the base component of the library. Till now it acts like a simple view-carousel:

import { ViewPager } from 'react-native-viewpager-carousel'

class ExampleCarousel extends PureComponent {

    constructor() {
        this.data = [
            { title: 'title 1' },
            { title: 'title 2' },
            { title: 'title 3' },
        ]
    }
    
    _renderPage = ({data}) => {
        return ( <Text>{item.title}</Text> )
    }

    render() {
        return (
            <ViewPager
                data={this.data}
                renderPage={this._renderPage}
            />
        )
    }
}

API

prop name data type default functionality
containerStyle style {} the component is wrapped into a <View />. Styles to this <View /> can be assigned through this property
contentContainerStyle style {} posibility to set styles to the content container (the entire scrollable area)
data array [] a data array of objects
dev boolean false draws a black line around the pages and tabs for debugging
lazyrender boolean false lazyrender renders the active page only when its in the viewport
lazyrenderThreshold number 1 determines how many threshold left and right the current visible page sould be rendered if lazyrender={true}
renderAsCarousel boolean true renders the as endless carousel
thresholdPages number 1 number of pages left and right of the scrollable content (sneak preview)
pageWidth number {{screen width of device}} width of page
initialPage object {} key value pair of initial page: e. g. data=[{key:'page-a'}, {key:'page-b'}] & initialPage={{key:'page-b}}
scrollEnabled boolean true decleares wether the ViewPager should be able to scroll by user or not
firePageChangeIfPassedScreenCenter boolean false toggle's if onPageChange sould already be called when the dragged page passed half of the screen
pagingEnabled boolean true
experimentalMirroring boolean false toggles the mirroring of the scrollposition of the threshold views - more information here
showNativeScrollIndicator boolean false native ScrollView indicator is disabled by default
renderPage function () => {} render callback for content page
onPageChange function () => {} callback when the page changes -> retuns the current pageNumber as first argument
onScroll function () => {} callback when the content area scrolls

TabbedPager

In addition to the <ViewPager /> the <TabbedPager /> component provides an additional renderFunction for Tabs above the content view. The following pseudo-code shows the basic usage with an <Image /> as content and a <Text /> as tab.

import { TabbedPager } from 'react-native-viewpager-carousel'

class ExampleCarousel extends PureComponent {

    constructor() {
        this.data = [
            { title: 'title 1', url: 'http://...' },
            { title: 'title 2', url: 'http://...' },
            { title: 'title 3', url: 'http://...' },
        ]
    }
    
    _renderTab = ({data}) => {
        return ( <Text>{data.title}</Text> )
    }
    
    _renderPage = ({data}) => {
        return ( <Image source={{uri: data.url}} /> )
    }

    render() {
        return (
            <ViewPager
                data={this.data}
                renderTab={this._renderTab}
                renderPage={this._renderPage}
            />
        )
    }
}

API

prop name data type default functionality
data array [] a data array of objects
dev boolean false draws a black line around the pages and tabs for debugging
fullScreen boolean true draws the in full screen mode (flex 1)
lazyrender boolean false lazyrender renders the active page only when its in the viewport
lazyrenderThreshold number 1 determines how many threshold left and right the current visible page sould be rendered if lazyrender={true}
renderAsCarousel boolean true renders the as endless carousel
tabContainerPosition string 'top' could be 'top' || 'bottom' - places the tab container on top of the viewpager or on the bottom side
scrollTabsEnabled boolean false
firePageChangeIfPassedScreenCenter boolean false toggle's if onPageChange sould already be called when the dragged page passed half of the screen
staticTabWidth number {{screen width of device / 2}}
initialPage object {} key value pair of initial page: e. g. data=[{key:'page-a'}, {key:'page-b'}] & initialPage={{key:'page-b}}
showTabIndicator boolean true toggles the tab indicator
tabIndicatorColor string 'transparent' changes the color of the tab indicator
tabIndicatorHeight number 2 height of tab indicator
tabsVisible boolean true indicates if tabs should be visible or not
DividerComponent any null renders a given Component between the tabs and the content area
renderPage function () => {} render callback for content page
renderTab function () => {} render callback for the tab
onPageChange function () => {} callback when the page changes -> retuns the current pageNumber as first argument
experimentalMirroring boolean false toggles the mirroring of the scrollposition of the threshold views - more information here
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].