0.0.6 • Published 4 years ago

react-native-popup-drawer v0.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

react-native-popup-drawer

· Pullable drawers up and down for react native.Support three paragraphs.

Installation

npm i -S react-native-popup-drawer

Usage

import React from 'react';
import {View} from 'react-native';
import PopupView from 'react-native-popup-drawer';

const Test = () => {
  const backgroundStyle = {
    height: '100%',
    width: '100%',
    backgroundColor: 'skyblue',
  };

  return (
    <View style={backgroundStyle}>
      <PopupView />
    </View>
  );
};

Preview

popupDrawer

API

Props

nametypedefaultdescription
skipMidboolfalseWhether to skip the middle segment (ie two-segment jump).
headToolsReactNodes-Custom tools at the top.
styleViewPropTypes.style-Drawer styles.
onDidScrollToPosition(swithState) => {}'post'Each segment switch callback (swithState: 0 -> top, 1 -> middlw, 2 -> bottom).

Methods

nametypedescription
setThreeHeight(firstHeight: number, secondHeight: number, thirdHeight: number) => {}Set the three heights of the drawer.
popToPosition(position: 0 | 1 | 2) => anyManually set the position of the drawer (0 -> top, 1 -> middle, 2-> bottom).

License

React is MIT licensed.