All Projects → Dekoruma → React Native Web Modal

Dekoruma / React Native Web Modal

Licence: mit
React Native Modal Implementation for Web

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Native Web Modal

react-native-card-animated-modal
An animated modal from a card item in a list for React Native.
Stars: ✭ 93 (-18.42%)
Mutual labels:  modal, animated
React Native Confetti Cannon
React Native confetti explosion and fall like iOS does.
Stars: ✭ 149 (+30.7%)
Mutual labels:  animated, react-native-web
Expo Dark Mode Switch
A beautiful React dark mode switch component for iOS, Android, and Web
Stars: ✭ 137 (+20.18%)
Mutual labels:  animated, react-native-web
React Native Modal
An enhanced, animated, customizable Modal for React Native.
Stars: ✭ 4,671 (+3997.37%)
Mutual labels:  animated, modal
Matchimals.fun
🦁 🃏 📱 An animal matching puzzle card game– built with turn-based game engine boardgame.io and React-Native + React-Native-Web
Stars: ✭ 101 (-11.4%)
Mutual labels:  react-native-web
Particles.js
A lightweight, dependency-free and responsive javascript plugin for particle backgrounds.
Stars: ✭ 1,336 (+1071.93%)
Mutual labels:  animated
Reoverlay
The missing solution for managing modals in React.
Stars: ✭ 91 (-20.18%)
Mutual labels:  modal
Flagship
🚢 A tool for building your best shopping app
Stars: ✭ 90 (-21.05%)
Mutual labels:  react-native-web
Redux Modal
Redux based modal
Stars: ✭ 107 (-6.14%)
Mutual labels:  modal
Sortinganimation
A visual representation for sorting algorithms
Stars: ✭ 105 (-7.89%)
Mutual labels:  animated
React Native Cross Platform Starter
One codebase to build for iOS, Android, Web and Desktop with React-Native
Stars: ✭ 101 (-11.4%)
Mutual labels:  react-native-web
React Modal Image
A tiny React component providing modal image Lightbox.
Stars: ✭ 97 (-14.91%)
Mutual labels:  modal
Bootstrap4 Fs Modal
A simple way to improve UX of Bootstrap 4 modals on mobile phones.
Stars: ✭ 102 (-10.53%)
Mutual labels:  modal
Match Media
Universal polyfill for match media API using Expo APIs on mobile
Stars: ✭ 95 (-16.67%)
Mutual labels:  react-native-web
React Modal Video
Accessible React Modal Video Component
Stars: ✭ 105 (-7.89%)
Mutual labels:  modal
React Native Rating
🌟 cross-platform rating for react-native built with Animated and native driver 🌟
Stars: ✭ 90 (-21.05%)
Mutual labels:  animated
Fas
C Pixels-based graphical audio synthesizer implemented as a WebSocket server
Stars: ✭ 100 (-12.28%)
Mutual labels:  modal
Ant Design Draggable Modal
The Modal from Ant Design, draggable.
Stars: ✭ 105 (-7.89%)
Mutual labels:  modal
Customalertviewdialogue
Custom AlertView Dialogue is the world's most advanced alert view library. Custom AlertView Dialogue includes simple message popups, confirmation alerts, selector popups, action sheet bottom menus, and input/feedback contact forms.
Stars: ✭ 100 (-12.28%)
Mutual labels:  modal
Reason React Native Web Example
Razzle + Reason-React + React-Native-Web. Damn that's a lot of R's.
Stars: ✭ 98 (-14.04%)
Mutual labels:  react-native-web


React Native Web Modal

Edit kxmx8w08jv


This repository contains NPM Packages for React Native Modal Implementation for Web


Announcement

Modal is now supported in react native web.

https://github.com/necolas/react-native-web/releases/tag/0.14.0

Thank you for using and supporting this library!

Inspiration

React Native Modal is not yet implemented in React Native Web. This is just replacement of React Native Modal with the same API, behavior, and design. If you want to create a more enhanced modal, use React Native Web Modal Enhanced with the same code as React Native Modal implementation by React Native Community.


Setup

Modal library is available on npm, install it with: npm install --save modal-react-native-web or yarn add modal-react-native-web for the basic modal.

If you want to use the enhanced version, install it with npm install --save modal-enhanced-react-native-web or yarn add modal-enhanced-react-native-web.

Usage

  1. React Native Web Modal

Since r-web-modal is an implemantion of the original react native modal, it works in a similar fashion with react-native modal. But of course, some APIs are limited (not all props are suppported).

import React, { Component } from 'react';
import { Text, TouchableHighlight, View } from 'react-native';

import Modal from 'modal-react-native-web';

export default class Example extends Component {
  state = {
    modalVisible: false,
  };

  setModalVisible(visible) {
    this.setState({modalVisible: visible});
  }

  render() {
    return (
      <View style={{marginTop: 22}}>
        <Modal
          animationType="slide"
          transparent={false}
          visible={this.state.modalVisible}
          onDismiss={() => {
            alert('Modal has been closed.');
          }}>
          <View style={{marginTop: 22}}>
            <View>
              <Text>Hello World!</Text>

              <TouchableHighlight
                onPress={() => {
                  this.setModalVisible(!this.state.modalVisible);
                }}>
                <Text>Hide Modal</Text>
              </TouchableHighlight>
            </View>
          </View>
        </Modal>

        <TouchableHighlight
          onPress={() => {
            this.setModalVisible(true);
          }}>
          <Text>Show Modal</Text>
        </TouchableHighlight>
      </View>
    );
  }
}

Taken from React Native Modal Example with some changes

  1. Modal Enhanced for React Native Web
import React, { Component } from "react";
import { Text, TouchableOpacity, View, ScrollView } from "react-native";

import Modal from 'modal-enhanced-react-native-web';

export default class Example extends Component {
  state = {
    visibleModal: null
  };

  _renderButton = (text, onPress) => (
    <TouchableOpacity onPress={onPress}>
      <View>
        <Text>{text}</Text>
      </View>
    </TouchableOpacity>
  );

  _renderModalContent = () => (
    <View>
      <Text>Hello!</Text>
      {this._renderButton("Close", () => this.setState({ visibleModal: false }))}
    </View>
  );

  _handleOnScroll = event => {
    this.setState({
      scrollOffset: event.nativeEvent.contentOffset.y
    });
  };

  _handleScrollTo = p => {
    if (this.scrollViewRef) {
      this.scrollViewRef.scrollTo(p);
    }
  };

  render() {
    return (
      <View>
        {this._renderButton("Modal that can be closed on backdrop press", () =>
          this.setState({ visibleModal: true })
        )}
        <Modal
          isVisible={this.state.visibleModal}
          onBackdropPress={() => this.setState({ visibleModal: false })}
        >
          {this._renderModalContent()}
        </Modal>
      </View>
    );
  }
}

The isVisible prop is the only prop you'll really need to make the modal work: you should control this prop value by saving it in your state and setting it to true or false when needed.

Taken from React Native Modal Example and RN Modal by React Native with some changes

See React Native Modal by React Native Community for APIs.

Available animations

Taken From React Native Modal by React Native Community

Take a look at react-native-animatable to see the dozens of animations available out-of-the-box. You can also pass in custom animation definitions and have them automatically register with react-native-animatable. For more information on creating custom animations, see the react-native-animatable animation definition schema.


Packages

 

React Native Web Modal

Enhanced Modal React Native Web

NPM
Description React Native Modal implemented for Web.
Implemented using React Native Web Animated and React DOM Portal
Enhanced Version of React Native Modal, implemented for web
Inspired by RNW Modal by Kiurchv React Native Modal by React Native Community
MIT License by React Native Community
Not yet supported - onRequestClose
- supportedOrientations
- hardwareAccelerated
- onOrientationChange
- presentationStyle
-

Author

Special Thanks

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].