UNPKG

1.66 kBMarkdownView Raw
1# react-stikky
2
3> It's very easy to sticky fixed target element.
4
5### Usage
6
7```
8import React from "react"
9import ReactDOM from "react-dom"
10import Stikky from "react-stikky"
11
12ReactDOM.render(
13 <Stikky edge="bottom">
14 <div>Hello world</div>
15 </Stikky>
16)
17
18```
19
20
21
22### Install
23
24```
25npm install --save react-stikky
26```
27
28### API
29
30#### `edge : String`
31
32> Choose where you want to sticky.("bottom" | "top")
33
34#### `triggerDistance : Number`
35
36> The distance to trigger the boundary.(default is 0)
37
38#### `zIndex : Number | String`
39
40#### `getStickyBoundary : Function`
41
42
43
44### LICENSE
45
46The MIT License (MIT)
47
48Copyright (c) 2018 JanryWang
49
50Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
51
52The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
53
54THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\No newline at end of file