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
所有者活动
創建於2018-10-22 08:47:38
推送於2024-06-08 01:52:12
最后一次提交2022-08-10 12:11:37
發布數84
最新版本名稱2.1.1 (發布於 )
第一版名稱1.0.0-alpha.0 (發布於 )
用户参与
星數2.9k
關注者數16
派生數301
提交數529
已啟用問題?
問題數332
打開的問題數101
拉請求數87
打開的拉請求數20
關閉的拉請求數66
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?