You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-1Lines changed: 20 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ This project scaffolding is from [react-component-template](https://github.com/c
10
10
11
11
Try out the demo at [https://compulim.github.io/react-scroll-to-bottom/](https://compulim.github.io/react-scroll-to-bottom/).
12
12
13
-
# Sample
13
+
# Sample code
14
14
15
15
```jsx
16
16
import { css } from'glamor';
@@ -31,6 +31,25 @@ export default props =>
31
31
32
32
> We use [`glamor`](https://github.com/threepointone/glamor/) for component styles. It is not required, but we don't support `style` props for performance reason.
33
33
34
+
## Props
35
+
36
+
| Name | Default | Description |
37
+
| - | - | - |
38
+
|`mode`|`"bottom"`| Set it to `"bottom"` for scroll-to-bottom, `"top"` for scroll-to-top. |
39
+
40
+
## Context
41
+
42
+
| Name | Type | Description |
43
+
| - | - | - |
44
+
|`atBottom`| Boolean |`true` if the panel is currently near bottom (see `threshold`) |
45
+
|`atEnd`| Boolean |`true` if the panel is currently near the end (see `mode` and `threshold`|
46
+
|`atTop`| Boolean |`true` if the panel is currently near top (see `threshold`) |
47
+
|`mode`| String |`"bottom"` for scroll-to-bottom, `"top"` for scroll-to-top |
48
+
|`scrollToBottom`| Function | Call to scroll panel to bottom |
49
+
|`scrollToEnd`| Function | Call to scroll panel to end |
50
+
|`scrollToTop`| Function | Call to scroll panel to top |
51
+
|`threshold`| Number | Threshold in pixels to consider the panel is near top/bottom, read-only and only set thru `props`|
52
+
34
53
# Contributions
35
54
36
55
Like us? [Star](https://github.com/compulim/react-scroll-to-bottom/stargazers) us.
0 commit comments