react-native-modalize

A modal that loves scrollable content.

Github星跟踪图

Modalize

npm version

A modal that loves scrollable content.

This component has been built with react-native-gesture-handler to address the common issue of scrolling, swipping and handling the keyboard behaviors, you can face with react-native's modal. This component comes with a ScrollView, the default content renderer, a FlatList and a SectionList. They are all three built-in and make your life easier, just pass your content and Modalize will handle the rest for you.

Installation

yarn add react-native-modalize

If you are not using expo, you will have to install react-native-gesture-handler

yarn add react-native-gesture-handler

Check out react-native-gesture-handler's documentation to set it up.

Usage

Here is the quick how-to example:

import React, { useRef } from 'react';
import { View, Text, TouchableOpacity } from 'react-native';
import { Modalize } from 'react-native-modalize';

export const MyApp = () => {
  const modalRef = useRef(null);

  const onOpen = () => {
    const modal = modalRef.current;

    if (modal) {
      modal.open();
    }
  };

  return (
    <>
      <TouchableOpacity onPress={onOpen}>
        <Text>Open the modal</Text>
      </TouchableOpacity>

      <Modalize ref={modalRef}>...your content</Modalize>
    </>
  );
};

Documentation

The full documentation is available here. There is multiple examples runing through differents navigators, with more informations here.

概览

名称与所有者jeremybarbet/react-native-modalize
主编程语言TypeScript
编程语言TypeScript (语言数: 3)
平台
许可证MIT License
发布数84
最新版本名称2.1.1 (发布于 )
第一版名称1.0.0-alpha.0 (发布于 )
创建于2018-10-22 08:47:38
推送于2023-12-19 15:11:17
最后一次提交2022-08-10 12:11:37
星数2.8k
关注者数18
派生数294
提交数529
已启用问题?
问题数326
打开的问题数98
拉请求数87
打开的拉请求数18
关闭的拉请求数66
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?
去到顶部