0.4.3 • Published 5 years ago

react-spoiler v0.4.3

Weekly downloads
30
License
MIT
Repository
github
Last release
5 years ago

npm version

react-spoiler

A spoiler component for reactjs

Demo https://827r7v3kxj.codesandbox.io/

Install

using yarn
yarn add react-spoiler

using npm
npm install react-spoiler

Usage

import ReactSpoiler from "react-spoiler";

<ReactSpoiler>
  <h1>ReactSpoiler</h1>
  <p> Click/Hover me to the magic! </p>
</ReactSpoiler>

Quick Start With unpkg CDN

Simply include following script

<script src="https://unpkg.com/react-spoiler@latest/dist/index.umd.js"></script>

Complete demo example using cdn

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>React Spoiler Example</title>
    <script src="https://unpkg.com/react@latest/umd/react.development.js"></script>
    <script src="https://unpkg.com/react-dom@latest/umd/react-dom.development.js"></script>

    <!-- Don't use this in production: -->
    <script src="https://unpkg.com/babel-standalone@latest/babel.min.js"></script>

    <script src="https://unpkg.com/react-spoiler@latest/dist/index.umd.js"></script>
  </head>
  <body>
    <div id="root"></div>
    <script type="text/babel">

      ReactDOM.render(
        <ReactSpoiler>
          <h1>ReactSpoiler</h1>
          <p> Click/Hover me to the magic! </p>
        </ReactSpoiler>,
        document.getElementById('root')
      );

    </script>
  </body>
</html>

Props

proptypedefaultdescription
showbooleanfalseshow/hide spoiler on initial render
tagstringdivdecides the type of rendered element
blurnumber4blur value on clicked
hoverBlurnumberblur/2blur value on hovered

Note: all other props will be passed to tag element.

License

MIT
0.4.3

5 years ago

0.4.3-beta.0

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

6 years ago

0.4.0-alpha-3

6 years ago

0.4.0-alpha-2

6 years ago

0.4.0-alpha

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago