12

A simple and fully customizable React Native onboarding component

 3 years ago
source link: https://reactnativeexample.com/a-simple-and-fully-customizable-react-native-onboarding-component/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Onboarding

A simple and fully customizable React Native onboarding component

Apr 25, 2021 1 min read

react-native-onboarding

A simple and fully customizable React Native component that implements a onboardin stepper.

react-native-onboarding

Installation

yarn add stepper-react-native
npm i stepper-react-native

Usage

import Onboarding from 'stepper-react-native'

//components
import Step1 from './step1';
import Step2 from './step2';
import Step3 from './step3';

//Component render inside onboarding
const steps = [
  {
    component: (<Step1 />),
  },
  {
    component: (<Step2 />),
  },
  {
    component: (<Step3 />),
  }
  
]

const ScreenOnboarding = (props) => {

  handleOnNext = ()=>{
    alert('ON next')
  }
  handleOnBack = ()=>{
    alert('ON BAck')
  }
  handleFinish = ()=>{
    alert('Oh Finish...')
  }
  return (
    <Onboarding
      screens={steps}
      onNext={()=>handleOnNext()}
      onPrevious={()=>handleOnBack()}
      onFinish={()=>handleFinish()}
    />
  )
}

export default ScreenOnboarding

Documentation

Step Component

| Name | Description | Default | Type |
| onNext | Function called when the next step button is pressed | null | Func |
| onPrevious | Function called when the previous step button is pressed | null | Func |
| onFinish | Function called when the onFinish step button is pressed | null | Func |

Author

Mateo Nieto

GitHub

https://github.com/MatheoNieto/react-native-onboarding


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK