• Stars
    star
    274
  • Rank 150,274 (Top 3 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 4 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

Would you like to support me?


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

react-native-bottomsheet-reanimated

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

Built from scratch with react-native-interactable-reanimated and react-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 use npm:

npm install react-native-bottomsheet-reanimated

If you are using Expo, you are done.

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

Usage

import BottomSheet from 'react-native-bottomsheet-reanimated';

class Example extends React.Component {
  render() {
    return (
      <View style={styles.container}>
        <BottomSheet
          keyboardAware
          bottomSheerColor="#FFFFFF"
          ref="BottomSheet"
          initialPosition={'50%'} //200, 300
          snapPoints={['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>
              <Text style={styles.text}>Header</Text>
            </View>
          }
          body={
            <View style={styles.body}>
              <Text style={styles.text}>Body</Text>
            </View>
          }
        />
      </View>
    );
  }
}

Props

name required default description
keyboardAware no false true will avoid current snap when keyboard will open.
overDrag no true false will disable overdrag of last snap, false will also disable bounce' and isModal`.
keyboardAwareExtraSnapHeight no 0 when keyboardAware=true and this is for adding extra space in snap when keyboard open
keyboardAwareDrag no false when keyboardAware=true and this is used for enable or disable drag when keyboard open
onChangeKeyboardAwareSnap no when keyboardAware=true then it give keyboard awareview snap. onChangeKeyboardAwareSnap: (previousSnap: number,nextSnap: number,keyboardHeight: number) => void;
snapPoints yes E.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.
initialPosition no 0 Determines initial position point of bottom sheet. The value outside of snap points.
body no Method for rendering scrollable content of bottom sheet.
header no Method for rendering non-scrollable header of bottom sheet.
isBackDrop no false for show backdrop behind the bottom sheet.
isBackDropDismissByPress no false enable to move bottomsheet to first snappoint by pressing backdrop.
isRoundBorderWithTipHeader no false give round with tip header style to bottomsheet.
isModal no false to make bottom sheet like modal.
bounce no 0.5 for increase or decrease bounce effect
isAnimatedYFromParent no If true then give animated value to animatedValueY props.
animatedValueY no If isAnimatedYFromParent will be true then it will give animtedY value to animatedValueY props.
bottomSheerColor no #ffffff for background color of bottom sheet.
tipStyle no for change style of tip. it is dependted on isRoundBorderWithTipHeader.
headerStyle no for change style of header.
bodyStyle no for change style of body.
dragEnabled no true for enable/disable drag
tipHeaderRadius no 12 for tip header border radius
onClose no Method call when bottomsheet close
containerStyle no for change style of container
bodyContainerStyle no for change style of body container
onChangeSnap no Method 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);

Here this.refs.BottomSheet refers to the ref passed to the BottomSheet component.

Example

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

yarn
cd Example
yarn
expo start

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Numan
Numan

πŸš‡ πŸ’»

More Repositories

1

react-native-compressor

πŸ—œοΈCompress Image, Video, and Audio same like Whatsapp πŸš€βœ¨
Kotlin
779
star
2

react-native-keys

πŸ” Protected .ENVs variables in React Native πŸš€βœ¨
C++
271
star
3

react-native-decompiler

Decompile React Native Android/IOS Bundle.
TypeScript
244
star
4

open-source-react-native-apps

πŸ“± Collaborative List of Open-Source React Native Apps
39
star
5

react-native-component-splitter

VS Code Extension allows splitting React Native Component into Sub-Component
TypeScript
36
star
6

react-native-interactable-reanimated

This is a copy of interactable from react-native-reanimated
JavaScript
34
star
7

react-native-curved-bottom-tabbar

Curved Bottom Tabbar React Native
JavaScript
26
star
8

mtsl

Tangible symlinks using cokidar (CLI)
JavaScript
22
star
9

github-emoji-extension

Github Emoji Chrome Extension πŸ‘πŸ‘ŽπŸ˜πŸŽ‰πŸ˜•β€πŸš€πŸ‘€
TypeScript
22
star
10

linkedin-auto-bot

LinkedIn bot for auto connect
JavaScript
18
star
11

intellij-merge-tool

VS Code extension for open merge tool of intellij
TypeScript
16
star
12

react-native-best-practice

React Native best practicesπŸ“šβœ¨
JavaScript
12
star
13

expo-library

CLI for creating reusable, modern Expo libraries using monorepo and expo init.
JavaScript
11
star
14

react-native-image-compressor

React Native Compress Image for Android And Ios
Objective-C
10
star
15

react-native-turbomodule-fabric-renderer-boilerpate

Turbomodule and Fabric renderer boilerplate
Java
9
star
16

release-notes-cli

Generate release notes from git commit history either commit range or tag range.
TypeScript
7
star
17

react-native-tiktok-progressbar

TIKTOK video progress bar
JavaScript
7
star
18

react-native-gifsicle

Compress, Optimize and Manipulate GIF in React Native πŸš€βœ¨
C
7
star
19

react-native-emoji-hook

Write emoji by emoji code :D = πŸ˜„
JavaScript
6
star
20

react-native-masonry-grid

Customizable masonry Flatlist. it just behave like Flatlist but using ScrollView behind the scene
TypeScript
6
star
21

react-native-process-text-intent

Get text from android android.intent.action.PROCESS_TEXT intent-filter
Java
5
star
22

rotate-video

Rotate Single video / Entire directory of videos with FFMPEG
JavaScript
4
star
23

decompiled-whatsapp

Java
3
star
24

ckeditor-boilerplate

JavaScript
2
star
25

clone-boilerplate

clone universal boilerplates for every language (CLI).
TypeScript
2
star
26

React-Native-Sift

Java
2
star
27

react-native-keyboardawareview-spacer

it is useful when you use Portal
JavaScript
2
star
28

react-native-jsi-boilerplate

React Native JSI boilerplate
C++
2
star
29

git-recover

Recover (git add) files that we lost accidentally
TypeScript
1
star
30

fabric-reanimated-repro

TypeScript
1
star
31

git-toolkit

This is a CLI and easy toolkit for git
JavaScript
1
star
32

ReactNativePhotoEditor

license test
Java
1
star
33

multiSearchReact

CSS
1
star
34

boilerplate-examples

add universal boilerplates for clone-boilerplate CLI.
PHP
1
star
35

react-native-usemarkdown-chat

hook for chats markdown in Textinput
TypeScript
1
star
36

nodejs-file-uploader

Nodejs file uploader server (PUT, POST) for https://github.com/numandev1/react-native-compressor backgroundUpload
JavaScript
1
star