GithubHelp home page GithubHelp logo

rajibchy / react-native-animated-overlay Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jacklam718/react-native-animated-overlay

0.0 1.0 0.0 271 KB

A Simple React Native Animated Overlay for iOS & Android.

JavaScript 100.00%

react-native-animated-overlay's Introduction

React Native Animated Overlay

React Native Animated Overlay for iOS & Android.

This component just provide a very basic overlay view for you to build something on top of this component.

Try it with Exponent

Example

Installation

npm install --save react-native-animated-overlay

Examples

Example

Usage

import React, { Component } from 'react';
import AnimatedOverlay from 'react-native-animated-overlay';

class AnimatedOverlayExample extends Component {
  constructor(props) {
    super(props);

    this.state = {
      overlayShow: false,
    };

    this.openOverlay = this.openOverlay.bind(this);
    this.closeOverlay = this.closeOverlay.bind(this);
  }

  openOverlay() {
    this.setState({overlayShow: true});
  }

  closeOverlay() {
    this.setState({overlayShow: false});
  }

  render() {
    return (
      <View style={styles.container}>
        <Button
          text="Open Overlay"
          onPress={this.openOverlay}
        />
        <AnimatedOverlay
          onPress={this.closeOverlay}
          backgroundColor='#000'
          opacity={0.5}
          duration={200}
          overlayShow={this.state.overlayShow}
        />
      </View>
    );
  }
}

Props

AnimatedOverlay

Prop Type Default Note
onPress? Function () => {}
onAnimationFinished? Function () => {}
backgroundColor? String #000
opacity? Number 0.5
duration? Number 200
overlayShow? Bool false
pointerEvents? string null
initValue? number 0
style? any null
useNativeDriver? boolean false
children? any null

react-native-animated-overlay's People

Contributors

jacklam718 avatar mpyw avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.