Skip to content

Commit a2e72c6

Browse files
committed
update README to match latest feature implementations
- offset can be defined as pixel value - removed pixel value feature request from roadmap - add explanation on addtional properties provided by callbacks
1 parent 9788ba4 commit a2e72c6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ These are the props you can set on the `Scrollama` component itself:
138138

139139
| Prop | Type | Default | Description |
140140
|----------------|---------------------------|---------|-----------------------------------------------------------------------------------------|
141-
| offset | `number` (from 0 to 1) | 0.3 | How far from the top of the viewport to trigger a step (as a proportion of view height) |
142-
| progress | `boolean` | false | Whether to fire incremental step progress updates |
141+
| offset | `number` (from 0 to 1) or pixel value (e.g. "300px") | 0.3 | How far from the top of the viewport to trigger a step (as a proportion of view height) |
143142
| threshold | `number` (greater than 1) | 4 | Granularity of the progress interval in pixels (smaller = more granular) |
144143
| onStepEnter | `function` | | Callback that fires when the top or bottom edge of a step enters the offset threshold. |
145144
| onStepExit | `function` | | Callback that fires when the top or bottom edge of a step exits the offset threshold. |
@@ -153,6 +152,7 @@ The `onStepEnter` and `onStepExit` callbacks receive one argument, an object, wi
153152
element, // The DOM node of the step that was triggered
154153
data, // The data supplied to the step
155154
direction, // 'up' or 'down'
155+
entry, // the original `IntersectionObserver` entry
156156
}
157157
```
158158

@@ -164,6 +164,7 @@ The `onStepProgress` callback receives one argument, an object, with the followi
164164
data, // The data supplied to the step
165165
progress, // The percent of completion of the step (0 to 1)
166166
direction, // 'up' or 'down'
167+
entry, // the original `IntersectionObserver` entry
167168
}
168169
```
169170

@@ -201,7 +202,6 @@ You will also probably want to set a `key` prop on each `Step` if you're transfo
201202

202203
## Features roadmap
203204

204-
* Being able to use pixels instead of percent for offset value so stuff on mobile doesn't jump around on scroll direction change
205205
* Currently, there is no way to throttle/customize React Scrollama's [resize listener](https://github.com/jsonkao/react-scrollama/blob/master/src/Scrollama.js#L104) 😢. We're working on this in [#44](https://github.com/jsonkao/react-scrollama/issues/44).
206206
* Fire previous step triggers if they were jumped
207207

0 commit comments

Comments
 (0)