3.0.1 • Published 2 months ago

react-native-slider-intro v3.0.1

Weekly downloads
74
License
MIT
Repository
github
Last release
2 months ago

npm version build platform react-native-slider-intro NPM total downloads license

runs with Expo Go

yarn add react-native-slider-intro

or

npm install react-native-slider-intro --save

iOS

yarn example ios

Android

yarn example android
import React from 'react';
import SliderIntro from 'react-native-slider-intro';

const slides = [
  {
    index: 1,
    title: 'First step',
    text: 'Simple description.',
    link: 'https://rnstudio.hu',
    image: require('./images/step1.png'),
    backgroundColor: '#febe29',
  },
  {
    index: 2,
    title: 'Second step',
    text: 'Simple description for the second step.',
    image: require('./images/step2.png'),
    backgroundColor: '#febe29',
  },
];

const BasicExample = ({ closeExample }: { closeExample: () => void }) => (
  <SliderIntro data={slides} onDone={closeExample} onSkip={closeExample} />
);

export default BasicExample;

The package includes two rendering options. In addition to the default render, where you can pass data as an array of SliderIntroItemProps, you can use a custom render with children and numberOfSlides properties.

NameTypeDefault valueDescription
dataarray[]Default render - An array of items. If data is provided, children will be ignored.
numberOfSlidesarraynumberCustom render - if children is provided, data will be ignored. numberOfSlides is required in this case.
childrenReactNodenullCustom render - JSX elements to render.
navigationBarBottomnumber0Custom bottom position of the dot navigation container.
navigationBarHeightnumber70Height of the dot navigation container.
animateSlideSpeednumber15Speed of the slider animation.
navContainerMaxSizePercentnumber0.5The maximum width of the navigation container as a percentage of the total width.
dotWidthnumber12The radius of the navigation dots.
fixDotOpacitynumber0.35Opacity of inactive (non-animated) dots.
fixDotBackgroundColorcolorgreyBackground color of inactive dots.
animatedDotBackgroundColorcolorwhiteBackground color of the animated dot.
animateDotSpeednumber8Speed of the dot animation.
animateDotBouncingnumber2Bounciness value of all animations. https://reactnative.dev/docs/animated#spring
skipLabelstringSkipCustom label for skip button.
nextLabelstringNextCustom label for next button.
doneLabelstringDoneCustom label for done button.
renderSkipButtonfunctionDefault skip/previous button rendererCustom renderer for the skip/previous button.
renderNextButtonfunctionDefault next button rendererCustom renderer for the next button.
renderDoneButtonfunctionDefault done button rendererCustom renderer for the done button.
onDonefunctionnoneCallback function executed when the done button is pressed.
onSkipfunctionnoneCallback function executed when the skip button is pressed.
showLeftButtonbooleantrueWhether to show the skip/previous button on the left side.
leftButtonTypestringskipThe button type on the left side, either skip or previous.
columnButtonStylebooleanfalseIf true, buttons will be displayed in a column.
limitToSlidenumber(Device max width) * 0.35Defines the slide animation limit, based on PanResponder's gestureState.dx property.

See the contributing guide to learn how to contribute to the repository and the development workflow.

MIT

2.1.18

4 months ago

3.0.1

2 months ago

2.1.17

7 months ago

2.1.14

12 months ago

2.1.13

1 year ago

2.1.8

1 year ago

2.1.4

1 year ago

2.1.1

1 year ago

2.0.11

1 year ago

2.0.1

1 year ago

1.0.19

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago