@jswork/react-fade-in-mask

1.0.0 • Public • Published

react-fade-in-mask

React fade in mask.

version license size download

installation

npm install -S @jswork/react-fade-in-mask

properties

Name Type Required Default Description
className string false - The extended className for component.
value bool false false The visible value.

usage

  1. import css
@import "~@jswork/react-fade-in-mask/dist/style.css";

// or use sass
@import "~@jswork/react-fade-in-mask/dist/style.scss";

// customize your styles:
$react-fade-in-mask-options: ()
  1. import js
import ReactDemokit from '@jswork/react-demokit';
import React from 'react';
import ReactDOM from 'react-dom';
import ReactFadeInMask from '@jswork/react-fade-in-mask';
import './assets/style.scss';

class App extends React.Component {
  constructor(inProps) {
    super(inProps);
    this.state = {
      value: false
    };
  }

  handleMouseEnter = (e) => {
    this.setState({ value: true });
  };

  handleMouseLeave = (e) => {
    this.setState({ value: false });
  };

  render() {
    const { value } = this.state;
    return (
      <ReactDemokit
        className="p-3 app-container"
        url="https://github.com/afeiship/react-fade-in-mask">
        <div
          className="is-box-item"
          onMouseEnter={this.handleMouseEnter}
          onMouseLeave={this.handleMouseLeave}>
          <img src="https://my.ishadowx.biz/img/portfolio/05-small.jpg" />
          <ReactFadeInMask value={value}>
            CONTENT FOR FADE_IN MASK!
          </ReactFadeInMask>
        </div>
      </ReactDemokit>
    );
  }
}

ReactDOM.render(<App />, document.getElementById('app'));

documentation

license

Code released under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i @jswork/react-fade-in-mask

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

18.6 kB

Total Files

7

Last publish

Collaborators

  • afeiship