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-bottom-modal-scrollable

v0.7.2

Published

Animated Modal component for React Native, A modal that can be extended using the finger and once the maximum height is reached the content will then start scrolling itself without having to release the finger. Compatible with Android & iOS.

Downloads

67

Readme

Bottom Scrollable Modal

A Bottom Modal component for React Native that can be dragged to the maximum height and without releasing the finger off the screen scroll its content to provide a smooth user experience. Fully customizable and compatible with Android & iOS. Built using react-native-reanimated 2.

Pull requests and feedbacks are welcome!

Overview

Installation

This package requires react-native-reanimated 2 and react-native-gesture-handler to work.

Then :

yarn add react-native-bottom-scrollable-modal

or using npm

npm install react-native-bottom-scrollable-modal

Quick start


import { BottomModalScrollable, BottomModalScrollableRef } from  'react-native-bottom-modal';

...

const modalRef = useRef<BottomModalScrollableRef>(null);

...

useEffect(()  => {
  modalRef.current?.open();
}, [])

return (
  <BottomModalScrollable
    ref={ref}
    children={
      <View>
        <Text>Hello</Text>
      </View>
    }
  />
);

Props

| Prop | Default | Type | Description | | --------------------------------------------------------------------------------- | ------------------------ | ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | children | | ReactNode | Content to render inside the modal | | footer | | AbsoluteFooter | | Element to render in absolute position over the modal at the bottom of the screen | | backgroundColor | #fff | string | Background color of the modal | | defaultModalHeight | 50% of the window height | number | Default height of the modal when opened | | maxModalHeight | 90% of the window height | number | Maximum height the modal can reach | | contentStaticHeight | | number | Only use this prop to set a static height for the content of the modal, if not provided the height will be calculated according to the children height (dynamically) | | onClose | | () => void | Callback called when the modal has been closed | | containerStyle | | ViewStyle | Style of the container | | dragIndicator | true | boolean | Show or not the dragging indicator at the top of the modal content | | screenHeight | Dimension window height | number | Use this props to overide the size in which the modal should work, useful if the modal should start after some elements which are at the bottom of the screen | | disableBackgroundOpacity | false | boolean | Disable the opacity applied on the background | | disableCloseOnBackgroundPress | false | boolean | If true then it will not close the modal when background is pressed | | disableSnapToBottom | false | boolean | If true the modal will not close when the user drag it down, instead it will snap to the defaultModalHeight | | backgroundClickable | false | boolean | If true the background will be pressable, usually this prop should be used with disableCloseOnBackgroundPress & disableBackgroundOpacity | | onEndReached | | () => void | Function called when the end of the content is reached | | onEndReachedThreshold | 100 | number | How far from the end in pixel the bottom edge of the content must be from the end of the content to trigger the onEndReached callback |

Example

Running the example app:

cd example && yarn

Starting the server:

yarn start

Running the app on iOS:

yarn ios

Running the app on Android:

yarn android

Known issues

As the content is displayed inside a custom scroll view it is not possible to use flex, which shouldn't be necessary as demonstrate in the example app.

License

MIT