Gathering detailed insights and metrics for react-native-app-intro-slider-mod
Gathering detailed insights and metrics for react-native-app-intro-slider-mod
Gathering detailed insights and metrics for react-native-app-intro-slider-mod
Gathering detailed insights and metrics for react-native-app-intro-slider-mod
Simple and configurable app introduction slider for react native
npm install react-native-app-intro-slider-mod
Typescript
Module System
Node Version
NPM Version
71.3
Supply Chain
99.3
Quality
75.2
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
384
Last Day
1
Last Week
2
Last Month
12
Last Year
70
MIT License
2 Stars
58 Commits
1 Forks
2 Watchers
18 Branches
1 Contributors
Updated on Jan 14, 2019
Latest Version
1.0.1
Package Id
react-native-app-intro-slider-mod@1.0.1
Unpacked Size
25.66 kB
Size
6.89 kB
File Count
5
NPM Version
8.5.0
Node Version
16.14.2
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
-60%
2
Compared to previous week
Last Month
100%
12
Compared to previous month
Last Year
-15.7%
70
Compared to previous year
No dependencies detected.
Easy-to-use yet very configurable app introduction slider/swiper
1npm i react-native-app-intro-slider --save
![]() | ![]() |
No configuration | showSkipButton | bottomButton and showSkipButton |
---|---|---|
![]() | ![]() | ![]() |
1import React from 'react'; 2import { StyleSheet } from 'react-native'; 3import AppIntroSlider from 'react-native-app-intro-slider'; 4 5const styles = StyleSheet.create({ 6 image: { 7 width: 320, 8 height: 320, 9 } 10}); 11 12const slides = [ 13 { 14 key: 'somethun', 15 title: 'Title 1', 16 text: 'Description.\nSay something cool', 17 image: require('./assets/1.jpg'), 18 imageStyle: styles.image, 19 backgroundColor: '#59b2ab', 20 }, 21 { 22 key: 'somethun-dos', 23 title: 'Title 2', 24 text: 'Other cool stuff', 25 image: require('./assets/2.jpg'), 26 imageStyle: styles.image, 27 backgroundColor: '#febe29', 28 }, 29 { 30 key: 'somethun1', 31 title: 'Rocket guy', 32 text: 'I\'m already out of descriptions\n\nLorem ipsum bla bla bla', 33 image: require('./assets/3.jpg'), 34 imageStyle: styles.image, 35 backgroundColor: '#22bcb5', 36 } 37]; 38 39export default class App extends React.Component { 40 this.state = { 41 showRealApp: false 42 } 43 _onDone = () => { 44 // User finished the introduction. Show real app through 45 // navigation or simply by controlling state 46 this.setState({ showRealApp: true }); 47 } 48 render() { 49 if (this.state.showRealApp) { 50 return <App />; 51 } else { 52 return <AppIntroSlider slides={slides} onDone={this._onDone}/>; 53 } 54 } 55}
1import React from 'react'; 2import { Ionicons } from '@expo/vector-icons'; 3import { StyleSheet, View } from 'react-native'; 4import AppIntroSlider from 'react-native-app-intro-slider'; 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 image: { 16 width: 320, 17 height: 320, 18 } 19}); 20 21// slides = [...] 22 23export default class App extends React.Component { 24 _renderNextButton = () => { 25 return ( 26 <View style={styles.buttonCircle}> 27 <Ionicons 28 name="md-arrow-round-forward" 29 color="rgba(255, 255, 255, .9)" 30 size={24} 31 style={{ backgroundColor: 'transparent' }} 32 /> 33 </View> 34 ); 35 } 36 _renderDoneButton = () => { 37 return ( 38 <View style={styles.buttonCircle}> 39 <Ionicons 40 name="md-checkmark" 41 color="rgba(255, 255, 255, .9)" 42 size={24} 43 style={{ backgroundColor: 'transparent' }} 44 /> 45 </View> 46 ); 47 } 48 render() { 49 return ( 50 <AppIntroSlider 51 slides={slides} 52 renderDoneButton={this._renderDoneButton} 53 renderNextButton={this._renderNextButton} 54 /> 55 ); 56 } 57}
1import React from 'react'; 2import { Ionicons } from '@expo/vector-icons'; 3import { StyleSheet, View } from 'react-native'; 4import AppIntroSlider from 'react-native-app-intro-slider'; 5 6const styles = StyleSheet.create({ 7 image: { 8 width: 320, 9 height: 320, 10 } 11}); 12 13const slides = [ 14 { 15 key: 'somethun', 16 title: 'Quick setup, good defaults', 17 text: 'React-native-app-intro-slider is easy to setup with a small footprint and no dependencies. And it comes with good default layouts!', 18 icon: 'ios-images-outline', 19 colors: ['#63E2FF', '#B066FE'], 20 buttons: [ 21 { 22 platform: 'ios', 23 title: 'Slide Button 1', 24 onPress: () => console.log('somethun custom button 1'), 25 containerStyle: {{ height: 44 }}, 26 buttonTextStyle: {{ color: '#000' }} 27 }, 28 { 29 platform: 'android', 30 title: 'Slide Button 2', 31 onPress: () => console.log('somethun custom button 2'), 32 containerStyle: {{ height: 44 }}, 33 buttonTextStyle: {{ color: '#000' }} 34 }, 35 { 36 platform: 'both', 37 title: 'Slide Button 3', 38 onPress: () => console.log('somethun custom button 3'), 39 containerStyle: {{ height: 44 }}, 40 buttonTextStyle: {{ color: '#000' }} 41 }, 42 ], 43 }, 44 { 45 key: 'somethun1', 46 title: 'Super customizable', 47 text: 'The component is also super customizable, so you can adapt it to cover your needs and wants.', 48 icon: 'ios-options-outline', 49 colors: ['#A3A1FF', '#3A3897'], 50 }, 51 { 52 key: 'somethun2', 53 title: 'No need to buy me beer', 54 text: 'Usage is all free', 55 icon: 'ios-beer-outline', 56 colors: ['#29ABE2', '#4F00BC'], 57 buttons: [ 58 { 59 title: 'Slide Button 3', 60 onPress: () => console.log('somethun2 custom button 1'), 61 containerStyle: {{ height: 44 }}, 62 buttonTextStyle: {{ color: '#000' }} 63 }, 64 { 65 title: 'Slide Button 4', 66 onPress: () => console.log('somethun2 custom button 2'), 67 containerStyle: {{ height: 44 }}, 68 buttonTextStyle: {{ color: '#000' }} 69 }, 70 ], 71 }, 72] 73 74export default class App extends React.Component { 75 render() { 76 return ( 77 <AppIntroSlider 78 slides={slides} 79 useSlideButtons 80 disableBottomButtonMargin 81 /> 82 ); 83 } 84}
1import React from 'react'; 2import { Ionicons } from '@expo/vector-icons'; 3import { StyleSheet, View, Text, Image } from 'react-native'; 4import { LinearGradient } from 'expo'; 5import AppIntroSlider from 'react-native-app-intro-slider'; 6 7const styles = StyleSheet.create({ 8 mainContent: { 9 flex: 1, 10 alignItems: 'center', 11 justifyContent: 'space-around', 12 }, 13 image: { 14 width: 320, 15 height: 320, 16 }, 17 text: { 18 color: 'rgba(255, 255, 255, 0.8)', 19 backgroundColor: 'transparent', 20 textAlign: 'center', 21 paddingHorizontal: 16, 22 }, 23 title: { 24 fontSize: 22, 25 color: 'white', 26 backgroundColor: 'transparent', 27 textAlign: 'center', 28 marginBottom: 16, 29 } 30}); 31 32const slides = [ 33 { 34 key: 'somethun', 35 title: 'Quick setup, good defaults', 36 text: 'React-native-app-intro-slider is easy to setup with a small footprint and no dependencies. And it comes with good default layouts!', 37 icon: 'ios-images-outline', 38 colors: ['#63E2FF', '#B066FE'], 39 }, 40 { 41 key: 'somethun1', 42 title: 'Super customizable', 43 text: 'The component is also super customizable, so you can adapt it to cover your needs and wants.', 44 icon: 'ios-options-outline', 45 colors: ['#A3A1FF', '#3A3897'], 46 }, 47 { 48 key: 'somethun2', 49 title: 'No need to buy me beer', 50 text: 'Usage is all free', 51 icon: 'ios-beer-outline', 52 colors: ['#29ABE2', '#4F00BC'], 53 }, 54]; 55 56export default class App extends React.Component { 57 _renderItem = props => ( 58 <LinearGradient 59 style={[styles.mainContent, { 60 paddingTop: props.topSpacer, 61 paddingBottom: props.bottomSpacer, 62 width: props.width, 63 height: props.height, 64 }]} 65 colors={props.colors} 66 start={{x: 0, y: .1}} end={{x: .1, y: 1}} 67 > 68 <Ionicons style={{ backgroundColor: 'transparent' }} name={props.icon} size={200} color="white" /> 69 <View> 70 <Text style={styles.title}>{props.title}</Text> 71 <Text style={styles.text}>{props.text}</Text> 72 </View> 73 </LinearGradient> 74 ); 75 76 render() { 77 return ( 78 <AppIntroSlider 79 slides={slides} 80 renderItem={this._renderItem} 81 bottomButton 82 /> 83 ); 84 } 85}
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 |
---|---|---|---|
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 |
bottomButton | boolean | false | Enable to show a full-width button under pagination |
useSlideButtons | boolean | false | Enable to use custom buttons for every single slide |
disableBottomButtonMargin | boolean | false | Enable to remove the margin from the bottom of slide for the buttons |
buttonStyle | style | null | Styling of outer button component |
buttonTextStyle | style | null | Styling of button text component |
dotStyle | style | {backgroundColor: 'rgba(0, 0, 0, .2)'} | Style of inactive pagination dots |
activeDotStyle | style | {backgroundColor: 'rgba(255, 255, 255, .9)'} | Style of active pagination dot |
hidePagination | boolean | false | Enable to hide the pagination |
renderNextButton | function | renders a Text-component | Use to supply your own next button |
renderPrevButton | function | renders a Text-component | Use to supply your own prev button |
renderDoneButton | function | renders a Text-component | Use to supply your own done button |
renderSkipButton | function | renders a Text-component | Use to supply your own skip button |
renderItem | function | renders DefaultSlide | Function returning a slide. The function is passed the slide object as wells as { topSpacer: Number, bottomSpacer: Number } . These show the "safe-space" where other UI is not interfering - take a look at DefaultSlide.js too see how they are set up. |
Name | Type | Default | Description |
---|---|---|---|
slides | object | No default, required | An array of slide-objects |
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 |
hideNextButton | boolean | false | Enable to hide the next button |
hideDoneButton | boolean | false | Enable to hide the done button |
onSlideChange | function | void | Called when user goes changes slide (by swiping or pressing next/prev). Function called with arguments index: number, lastIndex: number |
onDone | function | void | Called when user ends the introduction by pressing the done button |
onSkip | function | void | Called when user presses the skip button |
Each slide object should contain at least a unique key
. If you use the default layouts your object should furthermore contain:
Name | Type | Note |
---|---|---|
title | string | The title |
titleStyle | Style -prop | Styling for the title (e.g color, fontSize) |
text | string | Main text of slide |
textStyle | Style -prop | Styling for the text (e.g color, fontSize) |
image | Image -source prop | Slide image |
imageStyle | Style -prop | Styling for the image (e.g. size) |
backgroundColor | string | Slide background color |
buttons | array | Custom slide buttons. (e.g. buttons: [{ title: 'Button 1', onPress: () => console.log('button 1 clicked') }] ) |
Name | Type | Default | Note |
---|---|---|---|
title | string | No default, required | The button title |
platform | string | both | On which platform the button will be displayed. ios - android - both |
onPress | function | void | Called when user presses |
containerStyle | Style -prop | null | Styling for the button container (e.g. height) |
buttonTextStyle | Style -prop | null | Styling for the button text (e.g. color) |
If you use a custom renderItem
-method you can design your slide objects as you see fit.
You can run the example Expo-app by cloning the repo:
1git clone https://github.com/abdullahceylan/react-native-app-intro-slider.git 2cd react-native-app-intro-slider/Example 3yarn 4yarn start
No vulnerabilities found.
No security vulnerabilities found.