@@ -4,6 +4,12 @@ A react wrapper for the [nipplejs](https://www.npmjs.com/package/nipplejs) on-sc
44
55<img src =" https://raw.githubusercontent.com/loopmode/react-nipple/master/packages/react-nipple/preview.gif " />
66
7+ ### Resources
8+
9+ - Github repository: [ https://github.com/loopmode/react-nipple ] ( https://github.com/loopmode/react-nipple )
10+ - NPM package: [ https://www.npmjs.com/package/react-nipple ] ( https://www.npmjs.com/package/react-nipple )
11+ - Docs: [ https://loopmode.github.io/react-nipple/ ] ( https://loopmode.github.io/react-nipple/ )
12+
713## Installation
814
915``` bash
@@ -12,12 +18,6 @@ yarn add react-nipple
1218npm install --save react-nipple
1319```
1420
15- ### Resources
16-
17- - Github repository: [ https://github.com/loopmode/react-nipple ] ( https://github.com/loopmode/react-nipple )
18- - NPM package: [ https://www.npmjs.com/package/react-nipple ] ( https://www.npmjs.com/package/react-nipple )
19- - Docs: [ https://loopmode.github.io/react-nipple/ ] ( https://loopmode.github.io/react-nipple/ )
20-
2121## Usage
2222
2323Import and use the component. It supports all ` options ` from ` nipplejs ` .
@@ -40,7 +40,7 @@ class Example extends React.Component {
4040 options= {{ mode: ' static' , position: { top: ' 50%' , left: ' 50%' } }}
4141 // any unknown props will be passed to the container element, e.g. 'title', 'style' etc
4242 style= {{
43- outline: ` 1px dashed red` ,
43+ outline: ' 1px dashed red' ,
4444 width: 150 ,
4545 height: 150
4646 // if you pass position: 'relative', you don't need to import the stylesheet
@@ -84,22 +84,22 @@ import React from 'react';
8484import ReactNipple from ' react-nipple' ;
8585import DebugView from ' react-nipple/lib/DebugView' ;
8686
87- class ReactNippleExample extends React .Component {
87+ export default class DebugExample extends React .Component {
8888 state = {
8989 data: {}
9090 };
9191 render () {
9292 return (
9393 < div>
9494 < ReactNipple
95- options= {{mode: ' static' , position: {top: ' 50%' , left: ' 50%' } }}
95+ options= {{ mode: ' static' , position: { top: ' 50%' , left: ' 50%' } }}
9696 style= {{
97- outline: ` 1px dashed red` ,
97+ outline: ' 1px dashed red' ,
98+ color. ' blue' ,
9899 width: 150 ,
99- height: 150
100- position: ` relative`
100+ height: 150 ,
101+ position: ' relative'
101102 }}
102-
103103 onStart= {this .handleEvent }
104104 onEnd= {this .handleEvent }
105105 onMove= {this .handleEvent }
@@ -116,6 +116,6 @@ class ReactNippleExample extends React.Component {
116116 handleEvent = (evt , data ) => {
117117 console .log (evt);
118118 this .setState ({ data });
119- }
119+ };
120120}
121121```
0 commit comments