New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@gorhom/paper-onboarding

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gorhom/paper-onboarding

Paper Onboarding is a material design UI slider for `React Native`.

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31
decreased by-29.55%
Maintainers
1
Weekly downloads
 
Created
Source

Paper Onboarding

npm npm 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, and follow their installation instructions.

Usage

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

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

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

Props

namedescriptionrequiredtypedefault
dataArray of pages/slides to present.YESArray<PaperOnboardingItemType>
safeInsetsSafe area insets usually come from react-native-safe-area-context.NOInsets{top: 50, bottom: 50, left: 50, right: 50}
directionPan gesture direction.NO'horizontal' | 'vertical'horizontal
indicatorSizeIndicator size (width and height).NOnumber40
indicatorBackgroundColorIndicator background color.NOstringwhite
indicatorBorderColorIndicator border color.NOstringwhite
titleStyleText style to override all page/slide title style.NOStyleProp
descriptionStyleText style to override all page/slide description style.NOStyleProp
closeButtonCustom component to be used instead of the default close button.NO(() => React.ReactNode) | React.ReactNode
closeButtonTextClose button text.NOstringclose
closeButtonTextStyleClose button text style.NOStyleProp
onCloseButtonPressCallback on close button pressed.NO() => void
onIndexChangeCallback when index change.NO() => void
PaperOnboardingItemType
namedescriptionrequiredtype
contentSlide/page content, this will replace default content.NO((props: PageContentProps) => React.ReactNode) | React.ReactNode
imageImage cover.NO(() => React.ReactNode) | React.ReactNode
iconIndicator icon.NO(() => React.ReactNode) | React.ReactNode
backgroundColorBackground color.YESstring
titleTitle text.NOstring
descriptionDescription text.NOstring
titleStyleText style to override page/slide title default style.NOStyleProp
descriptionStyleText style to override page/slide description default style.NOStyleProp
showCloseButtonShow close button when page/slide is active, note: last page will always show close button.NOboolean

Methods

namedescriptiontype
nextNavigate to next page.() => void
previousNavigate to previous page.() => void

Built With ❤️

Author

License

MIT


Mo Gorhom

Keywords

FAQs

Package last updated on 28 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc