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-sliding-modal

v2.1.0

Published

A dynamic and customizable sliding modal developed in react-native.

Downloads

43

Readme

React Native Sliding Modal

This library provides a sliding and customizable modal responsive to panoramic gestures, using the React Native Gesture Handler library. All animations produced by this component use React Native's Animated library. The sliding-modal is also compatible with the React Navigation library components, then it won't be necessary to create a stack to open it in full-screen, since it is rendered in an upper layer of the application.

  • Note: To control the sliding-modal's properties types, the PropTypes library was used.

Installation

  • To install the library and its dependencies run: npm install --save react-native-gesture-handler prop-types react-native-sliding-modal

  • If you are using React Native 0.59 or lower, you will need to run: react-native link react-native-gesture-handler. Since version 0.60, library link commands happen automatically.

Example

import React, { useState } from 'react';
import SlidingModal from 'react-native-sliding-modal';

const ExemplaryModal = ({ children }) => {
  const [visible, setVisible] = useState(false);

  return (
    <SlidingModal
      isVisible={visible}
      handleVisible={setVisible}
    >
      {children}
    </SlidingModal>
  );
};

export default ExemplaryModal; 
  • Note: To control the sliding-modal visibility correctly, it will be necessary to create a state and assign it to the isVisible property. This same state must have a handler function that will be assigned to the handleVisible property.

Props

  • backgroundColor (String) - Sets the container background color.

  • borderRadius (Number) - Sets the container border radius.

  • containerType (String) - Defines which scroll container will be used, only identifies ScrollView or FlatList as parameter.

  • customIcon (Element) - Receives a component to replace the standard minimize icon.

  • direction (String) - Defines which direction the sliding-modal should expand when it opens. Only identifies top-to-bottom or bottom-to-top as parameter.

  • handleVisible (Func) - Receives a function to change the same state passed to the "isVisible" property. This function will set the state to false when the modal is closed by the swipeable area.

  • isVisible (Bool) - Sets the sliding-modal visibility. It must receive an external state.

  • minimizeBorderRadius (Number) - Sets the default icon border radius. It will be ignored if customIcon property exists.

  • minimizeColor (String) - Sets the default icon color. It will be ignored if customIcon property exists.

  • minimizeHeight (Number) - Sets the default icon height. It will be ignored if customIcon property exists.

  • minimizeWidth (Number) - Sets the default icon width. It will be ignored if customIcon property exists.

  • onClose (Func) - Receives a function to be called on sliding-modal close.

  • style (Object) - Assign additional styles to the container.

  • swipeableColor (String) - Sets the swipeable area background color.

  • swipeableSize (Number) - Sets the swipeable area height.

  • Note: in addition to these properties you can also use all the native props from ScrollView and FlatList, except these properties: contentContainerStyle, inverted, overScrollMode and showsVerticalScrollIndicator.