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

react-native-carousel-swiper

v1.0.11

Published

A refactored carousel from react-native-swiper < https://github.com/leecade/react-native-swiper >

Downloads

19

Readme

react-native-carousel

Yet another carousel... This allows for video and any type of component within the carousel.

This is meant for really low performance ANDROID tablets.

NOTE

Currently this module does not support IOS, as I only really needed it for android. I will fix this though.

Install

npm i --save react-native-carousel-swiper

or

yarn add react-native-carousel-swiper

Usage

import React, { Component } from "react";
import { View, Text, Image } from "react-native";
import Carousel from 'react-native-carousel';

export default class App extends Component {

  ...

  render() {
    return (
      <Carousel loop?={true | false} arrows?={true | false} bullets?={true | false}  loopTimer?={ number } >
        <Text>'Hello World!'</Text>
        <View><Text>'Hello World! 2'</Text></View>
        <Image source={{ uri: `<some Path>`, scale: 1 }} />
      </Carousel>
    );
  }
}

You may pass individual component attributes to the carousel. An example usecase is so to make an auto slider slide on a specific time for each component, like imagine an image is meant to slide for 10 seconds whilst the other image for 25 seconds.

To do this there MUST be a object that is passed (these are the MAIN attr that reads):

| Attributes | type | Description | | :---------: | :----: | :--------------------------------------: | | isVideo | bool | If it is a Video (**) | | runningtime | number | Time running each component (in seconds) |

** Video you will have to have either NPM: React Native Video or something else in your custom component. What this is doing is creating a empty black <View> so that ONLY when the video in being seen it loads. this is to make sure that we don't kill the tablet.

NOTE

For video you MUST add the attr isVideo.

example:

  let slideComponentsWAttr = [
    {attr: { isVideo: true, runningTime: 120 }, component: <CustomComponent /> }
    {attr: { runningTime: 25 }, component: <View /> }
    {component: <Text /> }
  ];

Example:

import React, { Component } from "react";
import { View, Text, Image } from "react-native";
import Carousel from 'react-native-carousel';
import CustomComponent from './customComponent/customComponent';

export default class App extends Component {

  ...

  let pages = [
    {attr: { isVideo: true, runningTime: 120 }, component: <CustomComponent /> }
    {attr: { runningTime: 25 }, component: <View /> }
    {component: <Text /> }
  ];

  render() {
    return (
      <Carousel loop?={true | false} arrows?={true | false} bullets?={true | false}  loopTimer?={ number } >
        {pages}
      </Carousel>
    );
  }
}

Props

| Props | type | Default | Description | | :-------: | :----: | :-----: | :-----------------------: | | loop | bool | true | Auto loop | | swipe | bool | true | Switch swipe on off | | arrows | bool | true | Show Arrows | | bullets | bool | true | Show Bullets (pagination) | | loopTimer | number | 5 | Time for auto loop |

Todo

  • Add IOS compatibility
  • Add custom styling into props
  • If on loop fade out Arrows, once touched show back arrows
  • TESTS. . . .

Contribute

There is a lot of things I still havent done due to time, more help would be really nice. If so please keep in mind that I would love to keep small components.