npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tttstudios/react-native-carousel

v1.1.0

Published

A React Native component to display images with transitions between them

Downloads

130

Readme

Banner

React Native Carousel

@tttstudios/react-native-carousel is a React Native component to make it simple to display a series of images with a crossfade animation between them.

Installation

npm install --save @tttstudios/react-native-carousel or yarn add @tttstudios/react-native-carousel

Installation Requirements

We make use of React hooks so make sure you have at least:

  • React 16.8
  • React Native 0.60

Usage

import { View } from 'react-native'
import { RNCarousel } from '@tttstudios/react-native-carousel'

...

    const bulbasaur = require('./assets/bulbasaur.png')
    const squirtle = require('./assets/squirtle.png')
    const charmander = require('./assets/charmander.png')

    const SOURCES = [bulbasaur, squirtle, charmander]

...

    <View style={{ flex: 1 }}>
        <RNCarousel sources={SOURCES}/>
    </View>

...

More Advanced Usage

import { RNCarousel } from '@tttstudios/react-native-carousel'

...

    const bulbasaur = require('./assets/bulbasaur.png')
    const squirtle = require('./assets/squirtle.png')
    const charmander = require('./assets/charmander.png')

    const SOURCES = [bulbasaur, squirtle, charmander]

...

  <RNCarousel
    sources={SOURCES}
    onItemIn={() => console.log('Hello!')}
    onItemOut={() => console.log('Bye!')}
    inFocusDuration={2000}
    animationDuration={1000}
    containerStyle={{ paddingHorizontal: 20 }}
    contentStyle={{ height: '50%' }}>
    <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
      <TouchableOpacity
        style={{
        height: 50,
        width: 300,
        backgroundColor: 'black',
        opacity: 0.75,
        borderRadius: 10,
        alignItems: 'center',
        justifyContent: 'center'}}
        onPress={() => console.log("You pressed me!")}>
        <Text style={{ fontSize: 16, color: 'white' }}>Gotta Catch 'Em All!</Text>
      </TouchableOpacity>
    </View>

...

Parameters

| Parameter | Required | Description | | ------------------ | -------- | ------------------------------------------------------- | | sources | YES | Images to be displayed | | onItemIn() | NO | Function called when an image goes out of view | | onItemOut() | NO | Function called when an image comes into view | | inFocusDuration | NO | Time in ms that an image is shown | | animationDuration | NO | Time in ms that the transition between two images takes | | children | NO | children to be displayed on top of carousel images | | containerStyle | NO | Styling applied to container | | contentStyle | NO | Styling applied to content |

Roadmap

  • [x] Typescript definition file
  • [x] Typescript implementation
  • [x] Add basic unit tests
  • [ ] Add integration tests
  • [ ] Add support for video

Contributors

Premium Support By TTT Studios

react-native-carousel is presented by the mobile team at TTT Studios. We are a Digital Innovation Studio based out of Vancouver, Canada, delivering custom software and solutions that are designed and developed 100% in-house. The technologies we work with include AR & VR, IoT, AI, security & encryption, and cloud computing.