Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

NotificationsYou must be signed in to change notification settings

gorhom/react-native-paper-onboarding

Repository files navigation

npmnpmnpm

Paper Onboarding is a material design UI slider forReact Native inspired byRamotion Paper Onboarding.


Installation

yarn add @gorhom/paper-onboarding# ornpm install @gorhom/paper-onboarding

Also, you need to installreact-native-reanimated,react-native-gesture-handler &react-native-svg, and follow their installation instructions.

Usage

importPaperOnboarding,{PaperOnboardingItemType}from"@gorhom/paper-onboarding";constdata: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 */,},];constScreen=()=>{consthandleOnClosePress=()=>console.log('navigate to other screen')return(<PaperOnboardingdata={data}onCloseButtonPress={handleOnClosePress}/>)}

Props

namedescriptionrequiredtypedefault
dataArray of pages/slides to present.YESArray<PaperOnboardingItemType>
safeInsetsSafe area insets usually come fromreact-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 overrideall page/slide title style.NOStyleProp
descriptionStyleText style to overrideall 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

Author

Sponsor & Support

To keep this library maintained and up-to-date please considersponsoring it on GitHub. Or if you are looking for a private support or help in customizing the experience, then reach out to me on Twitter@gorhom.

License

MIT

Built With ❤️


Mo Gorhom

About

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

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp