Giter Club home page Giter Club logo

react-native-paper-onboarding's Introduction

Paper Onboarding npm

Paper Onboarding is a material design UI slider for React Native inspired by Ramotion Paper Onboarding.

Installation

yarn add @gorhom/paper-onboarding
# or
npm install @gorhom/paper-onboarding

Also, you need to install react-native-reanimated, react-native-gesture-handler & react-native-svg

Usage

import PaperOnboarding, {PaperOnboardingItemType} from "@gorhom/paper-onboarding";

const data: PaperOnboardingItemType[] = [
  {
    title: 'Hotels',
    description: 'All hotels and hostels are sorted by hospitality rating',
    color: '#698FB8',
    image: /* IMAGE COMPONENT */,
    icon: /* ICON COMPONENT */,
  },
  {
    title: 'Banks',
    description: 'We carefully verify all banks before add them into the app',
    color: '#6CB2B8',
    image: /* IMAGE COMPONENT */,
    icon: /* ICON COMPONENT */,
  },
  {
    title: 'Stores',
    description: 'All local stores are categorized for your convenience',
    color: '#9D8FBF',
    image: /* IMAGE COMPONENT */,
    icon: /* ICON COMPONENT */,
  },
];

const Screen = () => {
  const handleOnClosePress = () => console.log('navigate to other screen')
  return (
    <PaperOnboarding
      data={data}
      onCloseButtonPress={handleOnClosePress}
    />
  )
}

Props

name required default description
data YES Array of pages/slides PaperOnboardingItemType to present.
safeInsets NO {top: 50, bottom: 50, left: 50, right: 50} Safe area insets usually come from react-native-safe-area-context.
direction NO horizontal Pan gusture direction. horizontal or vertical
indicatorSize NO 40 Indicator width and height.
indicatorColor NO white Indicator border and fill color.
titleStyle NO Text style to override all page/slide title default style.
descriptionStyle NO Text style to override all page/slide description default style.
clostButtonTextStyle NO Text style to override close button text default style.
closeButtonText NO close Text to be set in close button.
onCloseButtonPress YES Callback when user press on close button.

PaperOnboardingItemType

name required default description
image NO Image/component to be add the slide/page.
icon NO Image/component to be add the slide/page indicator.
color YES Background color for the slide/page.
title YES Title for the slide/page.
description YES Description for the slide/page.
titleStyle NO Text style to override page/slide title default style.
descriptionStyle NO Text style to override page/slide description default style.

Built With ❤️

Author

License

MIT

react-native-paper-onboarding's People

Contributors

gorhom avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.