Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-native-cards-swipe
Advanced tools
Readme
Powerful React Native Card Stack Swiper
npm install react-native-cards-swipe
import React from 'react';
import { Image, StyleSheet, View } from 'react-native';
import CardsSwipe from 'react-native-cards-swipe';
const cardsData = [
{ src: require('./assets/images/1.jpg') },
{ src: require('./assets/images/2.jpg') },
{ src: require('./assets/images/3.jpg') },
{ src: require('./assets/images/4.jpg') },
];
export default function App() {
return (
<View style={styles.container}>
<CardsSwipe
cards={cardsData}
cardContainerStyle={styles.cardContainer}
renderCard={(card) => (
<View style={styles.card}>
<Image
style={styles.cardImg}
source={card.src}
/>
</View>
)}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
alignItems: 'center',
justifyContent: 'center',
},
cardContainer: {
width: '92%',
height: '70%',
},
card: {
width: '100%',
height: '100%',
shadowColor: '#000000',
shadowOffset: {
width: 0,
height: 8,
},
shadowOpacity: 0.07,
shadowRadius: 3.3,
},
cardImg: {
width: '100%',
height: '100%',
borderRadius: 13,
},
});
Props | type | description | required | default |
---|---|---|---|---|
cards | array | data for the cards | yes | |
renderCard | func | renders the card with the current data | yes | |
initialIndex | number | initial card index | 0 | |
containerStyle | object | container style | {} | |
cardContainerStyle | object | cardContainerStyle style | {} | |
lowerCardZoom | number | lower card zoom | 0.95 | |
animDuration | number | card animation duration | 150 | |
horizontalThreshold | number | horizontal swipe threshold | width * 0.65 | |
rotationAngle | number | rotation angle (deg) for the card | 10 | |
loop | bool | keep swiping indefinitely | true | |
renderNoMoreCard | func | renders what is shown after swiped last card | () => null | |
renderYep | func | renders Yep label | () => null | |
renderNope | func | renders Nope label | () => null | |
onSwipeStart | func | function to be called when a card swipe starts | () => {} | |
onSwipeChangeDirection | func | function to be called when a card is active and changes its direction (left, right). | () => {} | |
onSwipeEnd | func | function to be called when a card swipe ends (card is released) | () => {} | |
onSwiped | func | function to be called when a card is swiped. it receives the swiped card index | () => {} | |
onSwipedLeft | func | function to be called when a card is swiped left. it receives the swiped card index | () => {} | |
onSwipedRight | func | function to be called when a card is swiped right. it receives the swiped card index | () => {} | |
onNoMoreCards | func | function to be called when all elements in array are finished | () => {} |
Props | type |
---|---|
swipeLeft | func |
swipeRight | func |
<CardsSwipe ref={swiper => { this.swiper = swiper }} />
<TouchableOpacity onPress={ () => { this.swiper.swipeLeft() }}>
<Text>Left</Text>
</TouchableOpacity>
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
FAQs
Powerful RN Card Swiper
The npm package react-native-cards-swipe receives a total of 332 weekly downloads. As such, react-native-cards-swipe popularity was classified as not popular.
We found that react-native-cards-swipe demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.