This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

react-native-slidingup-modal
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

react-native-slidingup-modal

SlidingUp modal for React Native

Installation

npm install react-native-slidingup-modal

Usage

import * as React from 'react';
import {
  SafeAreaView,
  StyleSheet,
  Text,
  TouchableOpacity,
  View,
} from 'react-native';
import ReactNativeSlidingUpModal from 'react-native-slidingup-modal';

export default function App() {
  const [visible, setVisible] = React.useState<boolean>(false);

  const handleToggleVisible = React.useCallback(() => {
    setVisible(!visible);
  }, [visible]);

  const handleRequestClose = React.useCallback(() => {
    setVisible(false);
  }, []);

  return (
    <>
      <View style={styles.container}>
        <TouchableOpacity onPress={handleToggleVisible}>
          <Text>Toggle modal</Text>
        </TouchableOpacity>
      </View>
      <ReactNativeSlidingUpModal
        visible={visible}
        style={styles.modalStyle}
        onRequestClose={handleRequestClose}
      >
        <SafeAreaView>
          <Text>Modal content</Text>
        </SafeAreaView>
      </ReactNativeSlidingUpModal>
    </>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    alignItems: 'center',
    justifyContent: 'center',
    backgroundColor: '#ffffff',
  },
  modalStyle: {
    marginTop: 60,
    borderTopLeftRadius: 25,
    borderTopRightRadius: 25,
    paddingTop: 16,
    paddingLeft: 16,
    paddingRight: 16,
  },
});

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

/react-native-slidingup-modal/

    Package Sidebar

    Install

    npm i react-native-slidingup-modal

    Weekly Downloads

    0

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    1.11 MB

    Total Files

    63

    Last publish

    Collaborators

    • thanhtunguet