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-da-slider

v0.1.10

Published

Easy to use slider

Downloads

9

Readme

react-native-da-slider

This component does not relly on other libs besides react-native.

The component uses nothing but react-native and PropTypes.

Contributing

Despite this is not a elaborated component, every contributing is very welcomed.

If you find using the component and having some problem, please file one ISSUE

If you think that you can improve the component, please open one PR

Instalation

yarn add react-native-da-slider

Usage

Basic

The slider will take the space of the parent container and the slider pages, will have diferent heights. No autoplay, loop or any customization.

<Slider
  pages={[
    () => <View style={{ backgroundColor: 'red', flex: 1 }}>
      <Text>Open up App.js to start working on your app!</Text>
    </View>
    ,
    () => <View style={{ backgroundColor: 'blue', height: 100 }}>
      <Text>Open up App.js to start working on your app!</Text>
    </View>
    ,
    () => <View style={{ backgroundColor: 'red', flex: 0.5 }}>
      <Text>Open up App.js to start working on your app!</Text>
    </View>
    ,
    () => <View style={{ backgroundColor: 'blue', height: 100 }}>
      <Text>Open up App.js to start working on your app!</Text>
    </View>
    ,
    () => <View style={{ backgroundColor: 'red', height: 100, }}>
      <Text>Open up App.js to start working on your app!</Text>
    </View>
    ,
    () => <View style={{ backgroundColor: 'blue', height: 100 }}>
      <Text>Open up App.js to start working on your app!</Text>
    </View>
  ]}
  >
</Slider>

With some features

<Slider
  loop
  autoplay
  height={100}
  autoplayInterval={2000}
  defaultPaginationActiveColor="black"
  defaultPaginationInactiveColor="blue"
  pages={[
    () => <View style={{ backgroundColor: 'red', height: 100, }}>
      <Text>Open up App.js to start working on your app!</Text>
    </View>
    ,
    () => <View style={{ backgroundColor: 'blue', height: 100 }}>
      <Text>Open up App.js to start working on your app!</Text>
    </View>
    ,
    () => <View style={{ backgroundColor: 'red', height: 100, }}>
      <Text>Open up App.js to start working on your app!</Text>
    </View>
    ,
    () => <View style={{ backgroundColor: 'blue', height: 100 }}>
      <Text>Open up App.js to start working on your app!</Text>
    </View>
    ,
    () => <View style={{ backgroundColor: 'red', height: 100, }}>
      <Text>Open up App.js to start working on your app!</Text>
    </View>
    ,
    () => <View style={{ backgroundColor: 'blue', height: 100 }}>
      <Text>Open up App.js to start working on your app!</Text>
    </View>
  ]}
>
</Slider>

Structure

  • example - This folder has one usage example with expo. You can do yarn start.
  • Slider - The component that you will use

Props

| Prop | Default | Type | Description | |--------------------------------|------------|------------|--------------------------------------------------------------------------------------------------------| | pages | isRequired | array | One array of function, where each function returns the page to be rendered by the splider | | overridePagination | false | 'bool' | One boolean indicating if the component default pagination will be rendered | | renderCustomPagination | () => { | 'function' | This callback allows you to add custom element to the default pagination element | | autoplay | false | bool | One boolean to indicate if the slider is on autoplay mode or not | | autoplayInterval | 2000 | number | The number of milliseconds between each autoplay loop. | | loop | false | 'bool' | Indicates if the component should allow to loop. Go from last index to the first and oposite | | onIndexChange | () => {} | 'function' | One callback that will be called each time the index of sliding page has already changed. | | height | undefined | number | This props lets you specify the height of the slider. The default will lead to flex meaning it will default to the slider container sizes. Use height to set slider container size | | defaultPaginationActiveColor | black | 'string | This string is the color to be used on the active page dot, when default pagination is not overriden | | defaultPaginationInactiveColor | white | 'string | This string is the color to be used on the inactive page dot, when default pagination is not overriden |

TODO

  • [ ] Extract to multiple components
  • [ ] Write unit tests