npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-bottomsheet-reanimated

v0.3.1

Published

react-native-bottomsheet-reanimated made with reanimted and interactable

Downloads

1,121

Readme

Would you like to support me?


| :warning: 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=trueand this is for adding extra space in snap when keyboard open | | keyboardAwareDrag | no |false | whenkeyboardAware=trueand this is used for enable or disable drag when keyboard open | | onChangeKeyboardAwareSnap | no | | whenkeyboardAware=truethen 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 | | Iftruethen give animated value toanimatedValueYprops. | | animatedValueY | no | | If isAnimatedYFromParent will betruethen it will give animtedY value toanimatedValueYprops. | | bottomSheerColor | no |#ffffff| for background color of bottom sheet. | | tipStyle | no | | for change style of tip. it is dependted onisRoundBorderWithTipHeader`. | | 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):