Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-mask-layer

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-mask-layer

Animatable mask layer, to hold anything you want.

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

react-mask-layer

Animatable mask layer, to hold anything you want.

Install

react-mask-layer

Usage


import MaskLayer from 'react-mask-layer';
import 'react-mask-layer/assets/index.css';

class App extends Component {
  constructor(props) {
    super(props);
    // initial state
    this.state = {
      maskerVisible: false,
    };
  }

  _maskCancel = e => {
    console.log('cancel target: ', e.target, ' type: ', e.type);
    this.setState({ maskerVisible: false });
  };

  _showOverlay = e => {
    console.log('show target: ', e.target, ' type: ', e.type);
    e.preventDefault();
    this.setState({ maskerVisible: true });
  };

  render() {
    return (
      <div className="App">
        <div onClick={this._showOverlay}>show mask layer</div>
        <MaskLayer visible={this.state.maskerVisible} onCancel={this._maskCancel} />
      </div>
    );
  }
}

API

NameTypeDefaultDescription
prefixClsStringmx-maskThe mask layer dom node's prefixCls
classNameStringadditional className for mask layer
wrapClassNameStringadditional className for mask layer wrap
styleObject{}Root style for mask layer element.Such as width, height
zIndexNumber
bodyStyleObject{}body style for mask layer body element.Such as height
maskStyleObject{}style for mask element
visibleBooleanfalsecurrent mask layer's visible status
animationStringpart of mask layer animation css class name
maskAnimationStringpart of mask layer's mask animation css class name
transitionNameStringmask layer animation css class name
maskTransitionNameStringmask animation css class name
maskClosableBooleantruewhether click mask to close
keyboardBooleantruewhether support press esc to close
mousePosition{x:number,y:number}set pageX and pageY of current mouse(it will cause transform origin to be set)
onClosefunction()called when click mask

License

react-mask-layer is available under the MIT license. See the LICENSE file for more info.

Keywords

FAQs

Package last updated on 02 Mar 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc