# react-native-cards-slider

> a simple cards slider component like airbnb has

Latest version **0.1.2** (published 2016-10-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-native-cards-slider
pnpm add react-native-cards-slider
yarn add react-native-cards-slider
bun add react-native-cards-slider
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.2 |
| Published | 2016-10-06 |
| First published | 2016-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 49 |
| Author | lock |
| Maintainers | liu9293 |
| Keywords | react, native, cards, react-component, ios, android, react-native, slider |

## Links

- npm: https://www.npmjs.com/package/react-native-cards-slider
- Repository: https://github.com/LIU9293/react-native-cards-slider
- Homepage: https://github.com/LIU9293/react-native-cards-slider#readme
- Issues: https://github.com/LIU9293/react-native-cards-slider/issues
- npm.io page: https://npm.io/package/react-native-cards-slider

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.1.2 (latest) — 2016-10-06
- 0.1.1 — 2016-09-23
- 0.1.0 — 2016-09-23

## README

# A simple cards slider like airbnb has

![preview.gif](https://github.com/LIU9293/react-native-cards-slider/blob/master/preview.gif)

## Autoplay (new)

    <CardSilder autoplay interval={4000}>
      {YOUR_AWESOME_CHILDREN}
    </CardSilder>

## Usage

    npm i react-native-cards-slider --save

example:

    import CardSilder from 'react-native-cards-slider';

    class example extends Component{
      render(){
        return(
          <CardSilder>
            <Image style={{height: 170}} source={{url : 'YOU_IMAGE_URL'}} />
            <Image style={{height: 170}} source={{url : 'YOU_IMAGE_URL'}} />
            <Image style={{height: 170}} source={{url : 'YOU_IMAGE_URL'}} />
            <Image style={{height: 170}} source={{url : 'YOU_IMAGE_URL'}} />
          </CardSilder>
        )
      }
    }

complete example in preview gif:

    import React, { Component } from 'react';
    import { Image, AppRegistry, Text, View } from 'react-native';
    import CardSilder from 'react-native-cards-slider';

    class App extends Component{
      render(){
        return(
          <View>
            <Text style={{fontSize: 30, color: '#000', marginTop:50, marginLeft:20, fontWeight:'bold'}}>
              Images
            </Text>
            <CardSilder style={{marginTop: 30}}>
              <Image style={{height: 170}} source={{url : 'YOUR_IMAGE'}} />
              <Image style={{height: 170}} source={{url : 'YOUR_IMAGE'}} />
              <Image style={{height: 170}} source={{url : 'YOUR_IMAGE'}} />
              <Image style={{height: 170}} source={{url : 'YOUR_IMAGE'}} />
            </CardSilder>
            <Text style={{fontSize: 30, color: '#000', marginTop:40, marginLeft:20, fontWeight:'bold'}}>
              Block with Text
            </Text>
            <CardSilder style={{marginTop: 30}}>
              <View style={{height: 170, justifyContent:'center', alignItems:'center', backgroundColor: 'skyblue'}}>
                <Text style={{color: 'white', fontSize: 24, fontWeight: 'bold'}}>
                  悉尼
                </Text>
              </View>
              <View style={{height: 170, justifyContent:'center', alignItems:'center', backgroundColor: 'lightsalmon'}}>
                <Text style={{color: 'white', fontSize: 24, fontWeight: 'bold'}}>
                  纽约
                </Text>
              </View>
              <View style={{height: 170, justifyContent:'center', alignItems:'center', backgroundColor: 'teal'}}>
                <Text style={{color: 'white', fontSize: 24, fontWeight: 'bold'}}>
                  东京
                </Text>
              </View>
              <View style={{height: 170, justifyContent:'center', alignItems:'center', backgroundColor: 'lightpink'}}>
                <Text style={{color: 'white', fontSize: 24, fontWeight: 'bold'}}>
                  上海
                </Text>
              </View>
            </CardSilder>
          </View>
        )
      }
    }

    AppRegistry.registerComponent('YOUR_APP_NAME', () => App);

CardSilder itself will set it's width to the device width.

So make sure you have enough space for it, and DO set a height for the children components.

Pull request welcome.

---
_Source: https://npm.io/package/react-native-cards-slider · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
