Gathering detailed insights and metrics for react-native-anchor-carousel
Gathering detailed insights and metrics for react-native-anchor-carousel
Gathering detailed insights and metrics for react-native-anchor-carousel
Gathering detailed insights and metrics for react-native-anchor-carousel
A simple swipeable carousel for React Native which anchor two side of list.
npm install react-native-anchor-carousel
Typescript
Module System
Node Version
NPM Version
71.9
Supply Chain
98.8
Quality
76.1
Maintenance
100
Vulnerability
100
License
JavaScript (62.01%)
Java (17.65%)
Objective-C (12.78%)
Starlark (5.45%)
Ruby (2.11%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
125 Stars
67 Commits
30 Forks
3 Watchers
5 Branches
1 Contributors
Updated on Feb 04, 2025
Latest Version
4.0.1
Package Id
react-native-anchor-carousel@4.0.1
Unpacked Size
13.91 kB
Size
4.72 kB
File Count
6
NPM Version
6.14.8
Node Version
14.15.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
A simple swipeable carousel for React Native which anchor two side of list.
Install the dependency.
1$ npm install react-native-anchor-carousel
1$ yarn add react-native-anchor-carousel
For older version, install 3.1.2
1$ npm install react-native-anchor-carousel@3.1.2
1$ yarn add react-native-anchor-carousel@3.1.2
1import Carousel from 'react-native-anchor-carousel'; 2const {width: windowWidth} = Dimensions.get('window'); 3const styles = StyleSheet.create({ 4 carousel: { 5 flexGrow: 0, 6 height: 150, 7 } 8});
Hook Component version:
1const carouselRef = React.useRef(null); 2renderItem = ({item, index}) => { 3 return ( 4 <TouchableOpacity 5 style={styles.item} 6 onPress={() => { 7 carouselRef.current.scrollToIndex(index); 8 }}> 9 ... 10 </TouchableOpacity> 11 ); 12} 13return (<Carousel 14 ref={carouselRef} 15 data={Array(3).fill(0)} 16 renderItem={renderItem} 17 style={styles.carousel} 18 itemWidth={windowWidth * 0.8} 19 containerWidth={windowWidth} 20 separatorWidth={0} 21/>)
Traditional Class Component version:
1renderItem = ({item, index}) => { 2 return ( 3 <TouchableOpacity 4 style={styles.item} 5 onPress={() => { 6 this.numberCarousel.scrollToIndex(index); 7 }}> 8 ... 9 </TouchableOpacity> 10 ); 11}; 12 13render() { 14 return ( 15 <Carousel 16 style={styles.carousel} 17 ref={c => { 18 this.numberCarousel = c; 19 }} 20 data={Array(3).fill(0)} 21 renderItem={this.renderItem} 22 itemWidth={windowWidth * 0.8} 23 separatorWidth={0} 24 containerWidth={windowWidth} 25 /> 26 ); 27}
This component currently just support only carousel for horizontal side carousel
From version 2.2.0.
It is now supported Flatlist props
from version 3.0.0 Change scroll behavior of previous versions
From version 4.0.0 it has been moved to Functional component and fix separator bug
Props | Description | Type | Default | Required |
---|---|---|---|---|
data | Array of data for rendering | Array | [] | Yes |
renderItems | take each item from data and renders it. Function receives one agrument {item,index} and must return as React.Element | Function | () => {} | Yes |
keyExtractor | Key extractor for each item of list | Function | (item, index) => index.toString() | Should |
Other Flatlist Props | Other Flatlist Props | |||
minScrollDistance | Minimum distance when scrolling to move to the next item. Notice this property when you need to improve smoothness | Number | 5 | No |
containerWidth | Width of the carousel container box | Number | Screen width | Yes |
itemWidth | Width of each item in carousel | Number | 90% of screen width | Yes |
separatorWidth | Width of separator in carousel (cause it only support horizontal side at the present time) | Number | 10 | No |
inActiveScale | Value of the scale effect applied to inactive item | Number | 0.8 | No |
inActiveOpacity | Value of the opacity effect applied to inactive item | Number | 0.8 | No |
style | Style of the carousel container box | View style | {} | No |
itemContainerStyle | Style for each carousel container item | View style | {} | No |
onScrollEnd | Fired while scrollview end of scrolling | Function | ()=> {} | No |
initialIndex | Initial starting focused item of list | Number | 0 | No |
This library is written after taking reference from react-native-snap-carousel
Welcome everybody to contribute ! Hope this simple carousel can help somebody for fast develope react-native app!
MIT
Free Software, Hell Yeah!
No vulnerabilities found.
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/16 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More