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

React Native bottom sheet with fully native 60 FPS animations and awesome user experience

License

NotificationsYou must be signed in to change notification settings

numandev1/react-native-bottomsheet-reanimated

Repository files navigation


Buy Me A Coffee

⚠️ IMPORTANT: This Library has been deprecated in favor ofreact-native-bottom-sheet because this Library is using Reanimated V1

react-native-bottomsheet-reanimated

Highly configurable component imitatingnative bottom sheet behavior, with fully native 60 FPS animations!

Built from scratch withreact-native-interactable-reanimated andreact-native-reanimated.

Usable with Expo with no extra native dependencies!

Installation

Open a Terminal in the project root and run:

yarn add react-native-bottomsheet-reanimated react-native-interactable-reanimated

or if you usenpm:

npm install react-native-bottomsheet-reanimated

If you are using Expo, you are done.

If you don't use Expo, install and linkreact-native-gesture-handler andreact-native-reanimated.

Usage

importBottomSheetfrom'react-native-bottomsheet-reanimated';classExampleextendsReact.Component{render(){return(<Viewstyle={styles.container}><BottomSheetkeyboardAwarebottomSheerColor="#FFFFFF"ref="BottomSheet"initialPosition={'50%'}//200, 300snapPoints={['50%','100%']}isBackDrop={true}isBackDropDismissByPress={true}isRoundBorderWithTipHeader={true}// backDropColor="red"// isModal// containerStyle={{backgroundColor:"red"}}// tipStyle={{backgroundColor:"red"}}// headerStyle={{backgroundColor:"red"}}// bodyStyle={{backgroundColor:"red",flex:1}}header={<View><Textstyle={styles.text}>Header</Text></View>}body={<Viewstyle={styles.body}><Textstyle={styles.text}>Body</Text></View>}/></View>);}}

Props

namerequireddefaultdescription
keyboardAwarenofalsetrue will avoid current snap when keyboard will open.
overDragnotruefalse will disable overdrag of last snap,false will also disablebounce' andisModal`.
keyboardAwareExtraSnapHeightno0whenkeyboardAware=true and this is for adding extra space in snap when keyboard open
keyboardAwareDragnofalsewhenkeyboardAware=true and this is used for enable or disable drag when keyboard open
onChangeKeyboardAwareSnapnowhenkeyboardAware=true then it give keyboard awareview snap. onChangeKeyboardAwareSnap: (previousSnap: number,nextSnap: number,keyboardHeight: number) => void;
snapPointsyesE.g.[300, 200, 0]. Points for snapping of bottom sheet coomponent. They define distance from bottom of the screen. Might be number or percent (as string e.g.'20%') for points or percents of screen height from bottom. Note: Array values must be in descending order.
initialPositionno0Determines initial position point of bottom sheet. The value outside of snap points.
bodynoMethod for rendering scrollable content of bottom sheet.
headernoMethod for rendering non-scrollable header of bottom sheet.
isBackDropnofalsefor show backdrop behind the bottom sheet.
isBackDropDismissByPressnofalseenable to move bottomsheet to first snappoint by pressing backdrop.
isRoundBorderWithTipHeadernofalsegive round with tip header style to bottomsheet.
isModalnofalseto make bottom sheet like modal.
bounceno0.5for increase or decrease bounce effect
isAnimatedYFromParentnoIftrue then give animated value toanimatedValueY props.
animatedValueYnoIf isAnimatedYFromParent will betrue then it will give animtedY value toanimatedValueY props.
bottomSheerColorno#fffffffor background color of bottom sheet.
tipStylenofor change style of tip. it is dependted onisRoundBorderWithTipHeader.
headerStylenofor change style of header.
bodyStylenofor change style of body.
dragEnablednotruefor enable/disable drag
tipHeaderRadiusno12for tip header border radius
onClosenoMethod call when bottomsheet close
containerStylenofor change style of container
bodyContainerStylenofor change style of body container
onChangeSnapnoMethod call when change any snap

Methods

snapTo(index)

Imperative method on for snapping to snap point in given index. E.g.

// Snap to the snap point at index 0 (e.g. 450 in [450, 300, 0])this.refs.BottomSheet.current.snapTo(0);

Herethis.refs.BottomSheet refersto theref passed to theBottomSheet component.

Example

More complex examples can be found in theExample folder. To view the examples in theExpo app, open a Terminal and run:

yarncd Exampleyarnexpo start

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Numan
Numan

🚇💻

About

React Native bottom sheet with fully native 60 FPS animations and awesome user experience

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

    Packages

    No packages published

    Contributors3

    •  
    •  
    •  

    [8]ページ先頭

    ©2009-2025 Movatter.jp