0.4.3 • Published 5 years ago
react-spoiler v0.4.3
react-spoiler
A spoiler component for reactjs
Demo https://827r7v3kxj.codesandbox.io/
Install
using yarnyarn add react-spoiler
using npmnpm 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
prop | type | default | description |
---|---|---|---|
show | boolean | false | show/hide spoiler on initial render |
tag | string | div | decides the type of rendered element |
blur | number | 4 | blur value on clicked |
hoverBlur | number | blur /2 | blur 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