Gathering detailed insights and metrics for react-native-app-intro-slider-cardview
Gathering detailed insights and metrics for react-native-app-intro-slider-cardview
Gathering detailed insights and metrics for react-native-app-intro-slider-cardview
Gathering detailed insights and metrics for react-native-app-intro-slider-cardview
npm install react-native-app-intro-slider-cardview
Typescript
Module System
Node Version
NPM Version
71.3
Supply Chain
98.3
Quality
75
Maintenance
100
Vulnerability
99.6
License
Built with Next.js • Fully responsive • SEO optimized • Open source ready
Total Downloads
784
Last Day
3
Last Week
3
Last Month
4
Last Year
128
Latest Version
1.0.2
Package Id
react-native-app-intro-slider-cardview@1.0.2
Unpacked Size
26.90 kB
Size
7.26 kB
File Count
10
NPM Version
6.14.4
Node Version
14.4.0
Cumulative downloads
Total Downloads
Last Day
0%
3
Compared to previous day
Last Week
0%
3
Compared to previous week
Last Month
0%
4
Compared to previous month
Last Year
13.3%
128
Compared to previous year
No dependencies detected.
An easy-to-use yet very configurable app introduction slider/swiper based on FlatList that supports RTL. Original Author: https://www.npmjs.com/package/react-native-app-intro-slider
1yarn add react-native-app-intro-slider-cardview
Basic | showSkipButton | bottomButton and showSkipButton |
---|---|---|
![]() | ![]() | ![]() |
The component is based on FlatList so usage is very similar. Pass a data-array to AppIntroSlider along with a renderItem
-function:
1import React from 'react'; 2import { StyleSheet } from 'react-native'; 3import AppIntroSlider from 'react-native-app-intro-slider-cardview'; 4 5const slides = [ 6 { 7 key: 1, 8 title: 'Title 1', 9 text: 'Description.\nSay something cool', 10 image: require('./assets/1.jpg'), 11 backgroundColor: '#59b2ab', 12 }, 13 { 14 key: 2, 15 title: 'Title 2', 16 text: 'Other cool stuff', 17 image: require('./assets/2.jpg'), 18 backgroundColor: '#febe29', 19 }, 20 { 21 key: 3, 22 title: 'Rocket guy', 23 text: 'I\'m already out of descriptions\n\nLorem ipsum bla bla bla', 24 image: require('./assets/3.jpg'), 25 backgroundColor: '#22bcb5', 26 } 27]; 28 29export default class App extends React.Component { 30 this.state = { 31 showRealApp: false 32 } 33 _renderItem = ({ item }) => { 34 return ( 35 <View style={styles.slide}> 36 <Text style={styles.title}>{item.title}</Text> 37 <Image source={item.image} /> 38 <Text style={styles.text}>{item.text}</Text> 39 </View> 40 ); 41 } 42 _onDone = () => { 43 // User finished the introduction. Show real app through 44 // navigation or simply by controlling state 45 this.setState({ showRealApp: true }); 46 } 47 render() { 48 if (this.state.showRealApp) { 49 return <App />; 50 } else { 51 return <AppIntroSlider renderItem={this._renderItem} data={slides} onDone={this._onDone}/>; 52 } 53 } 54}
1import React from "react"; 2import Icon from "react-native-vector-icons/Ionicons"; 3import { StyleSheet, View } from "react-native"; 4import AppIntroSlider from "react-native-app-intro-slider-cardview"; 5 6const styles = StyleSheet.create({ 7 buttonCircle: { 8 width: 40, 9 height: 40, 10 backgroundColor: "rgba(0, 0, 0, .2)", 11 borderRadius: 20, 12 justifyContent: "center", 13 alignItems: "center", 14 }, 15 //[...] 16}); 17 18// slides = [...] 19 20export default class App extends React.Component { 21 _renderItem = ({ item }) => { 22 return ( 23 <View style={styles.slide}> 24 <Text style={styles.title}>{item.title}</Text> 25 <Image source={item.image} /> 26 <Text style={styles.text}>{item.text}</Text> 27 </View> 28 ); 29 }; 30 _renderNextButton = () => { 31 return ( 32 <View style={styles.buttonCircle}> 33 <Ion 34 name="md-arrow-round-forward" 35 color="rgba(255, 255, 255, .9)" 36 size={24} 37 /> 38 </View> 39 ); 40 }; 41 _renderDoneButton = () => { 42 return ( 43 <View style={styles.buttonCircle}> 44 <Ion name="md-checkmark" color="rgba(255, 255, 255, .9)" size={24} /> 45 </View> 46 ); 47 }; 48 render() { 49 return ( 50 <AppIntroSlider 51 data={slides} 52 renderDoneButton={this._renderDoneButton} 53 renderNextButton={this._renderNextButton} 54 /> 55 ); 56 } 57}
Here a custom renderItem
is supplied and the bottomButton
-props has been set to true
. Notice how the setup of slides
has been configured to support icons and gradient backgrounds.
The component extends FlatList
so all FlatList-props are valid.
Name | Type | Default | Description |
---|---|---|---|
data | object | None, required | An array of objects (they should either contain a unique key -prop or you should pass a keyExtractor -function to the component) |
renderItem | function | None, required | FlatList's renderItem. Receives ({item, index, dimensions}) where dimensions contains height and width of the slides |
onSlideChange | function | void | Called when user goes changes slide (by swiping or pressing next/prev). Function called with arguments (index: number, lastIndex: number) |
renderPagination | function | Function to render a custom pagination/button component on top of slides. Receives the index of the currently active slide | |
onDone | function | void | Called when user ends the introduction by pressing the done button |
onSkip | function | Scrolls to the end | Called when user presses the skip button |
bottomButton | boolean | false | Enable to show a full-width button under pagination |
dotStyle | style | {backgroundColor: 'rgba(0, 0, 0, .2)'} | Style of inactive pagination dots |
dotClickEnabled | boolean | true | Whether users can navigate using the pagination dots |
activeDotStyle | style | {backgroundColor: 'rgba(255, 255, 255, .9)'} | Style of active pagination dot |
skipLabel | string | Skip | Custom label for Skip button |
doneLabel | string | Done | Custom label for Done button |
nextLabel | string | Next | Custom label for Next button |
prevLabel | string | Back | Custom label for Prev button |
showSkipButton | boolean | false | Enable to show a skip button to the left of pagination dots. When bottomButton == true the skip button is a small text under the full-width next button |
showPrevButton | boolean | false | Enable to show a previous button. If showSkipButton is true, the skip button will be displayed on the first page and prev button on subsequent one |
showNextButton | boolean | true | Disable to hide the next button |
showDoneButton | boolean | true | Disable to hide the done button |
renderNextButton | function | renders a Text-component | Use to supply your own next button. Has no effect if using renderPagination . |
renderPrevButton | function | renders a Text-component | Use to supply your own prev button . Has no effect if using renderPagination |
renderDoneButton | function | renders a Text-component | Use to supply your own done button. Has no effect if using renderPagination |
renderSkipButton | function | renders a Text-component | Use to supply your own skip button. Has no effect if using renderPagination |
Method Name | Arguments | Description |
---|---|---|
goToSlide | number | Change to slide with specified index |
getListRef | none | Returns the Flat List ref |
No vulnerabilities found.