0.0.5 • Published 2 years ago

react-native-onboarding-modal v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Installation

Add the dependency:

npm i react-native-onboarding-modal

Peer Dependencies

"react-native-modal": ">=  13.0.0",
"react-native-snap-carousel": ">=  3.9.1"

Usage

Import

import OnboardingModal, { IOnboardingModal } from "react-native-onboarding-modal";

Data Format

const exampleData: IOnboardingModal = [
  {
    title: 'Love Nature',
    subtitle: "Let's live close to nature",
    asset: require('./assets/watering.png'),
  },
}

Basic Usage

<OnboardingModal
  data={exampleData}
  onBottomButtonPress={() => console.log("Handle Let's Go Button")}
/>

Advanced Usage

<OnboardingModal
  onboardingData={exampleData}
  buttonTextColor="#51186E"
  buttonBackgroundColor="#DCCFE2"
  photoStyle={{ width: 300, height: 300 }}
  titleStyle={{ fontSize: 32, color: "#8066BA" }}
  onBottomButtonPress={() => console.log("Handle Let's Go Button")}
/>

Configuration - Props

Fundamentals

PropertyTypeDefaultDescription
onboardingDataIOnboardingModalundefinedset data shown in modal

Customization (Optionals)

PropertyTypeDefaultDescription
carouselRefanyundefinedset carouselRef prop for carousel
disableBottomButtonbooleanfalseset visibility of the bottom button
buttonContainerCustomViewStylePropdefaultset your own component instead of default bottom button component
buttonBackgroundColorstring#21AE79change the button's text color
buttonTextstringLet's Gochange the button's text
buttonTextColorstring#fefefechange the button's text color
onBottomButtonPressfunctiondefaulthandle bottom button is pressed
cardContainerStyleViewStyledefaultset or override the style object for the modal main container
carouselItemContainerCustomViewStylePropdefaultset your own component instead of default react-native-snap-carousel component
titleStyleTitleStyledefaultset or override the style object for the title text style
subtitleStyleTitleStyledefaultset or override the style object for the subtitle text style
photoStyleImageStyledefaultset or override the style object for the photo style

Future Plans

  • LICENSE

Change Log

Change log will be here !

Author

Sevval Eygul, sevvalleygull@gmail.com

License

React Native Onboarding Modal is available under the MIT license. See the LICENSE file for more info.