|
1 | 1 | # React Scrollama 🦙
|
2 | 2 |
|
3 | 3 | <p align="left">
|
4 |
| - <a href="https://www.npmjs.com/package/react-scrollama"> |
5 |
| - <img src="https://img.shields.io/npm/v/react-scrollama.svg" alt="npm version"/> |
| 4 | + <a href="https://npmjs.com/package/react-scrollama"> |
| 5 | + <img src="https://img.shields.io/npm/v/react-scrollama?style=flat&colorA=080f12&colorB=1fa669" alt="npm version"/> |
| 6 | + </a> |
| 7 | + <a href="https://npmjs.com/package/react-scrollama"> |
| 8 | + <img src="https://img.shields.io/npm/dm/react-scrollama?style=flat&colorA=080f12&colorB=1fa669" alt="npm downloads"/> |
| 9 | + </a> |
| 10 | + <a href="https://bundlephobia.com/result?p=react-scrollama"> |
| 11 | + <img src="https://img.shields.io/bundlephobia/minzip/react-scrollama?style=flat&colorA=080f12&colorB=1fa669&label=minzip" alt="package size"/> |
| 12 | + </a> |
| 13 | + <a href="https://github.com/jsonkao/react-scrollama/blob/master/LICENSE"> |
| 14 | + <img src="https://img.shields.io/github/license/jsonkao/react-scrollama.svg?style=flat&colorA=080f12&colorB=1fa669" alt="license"/> |
| 15 | + </a> |
| 16 | + <a href="https://www.jsdocs.io/package/react-scrollama"> |
| 17 | + <img src="https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669" alt="jsdocs reference"/> |
6 | 18 | </a>
|
7 | 19 | </p>
|
8 | 20 |
|
@@ -138,14 +150,14 @@ React Scrollama components do not render into the DOM. They are meant to set up
|
138 | 150 |
|
139 | 151 | These are the props you can set on the `Scrollama` component itself:
|
140 | 152 |
|
141 |
| -| Prop | Type | Default | Description | |
142 |
| -|----------------|---------------------------|---------|-----------------------------------------------------------------------------------------| |
143 |
| -| 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) | |
144 |
| -| threshold | `number` (greater than 1) | 4 | Granularity of the progress interval in pixels (smaller = more granular) | |
145 |
| -| onStepEnter | `function` | | Callback that fires when the top or bottom edge of a step enters the offset threshold. | |
146 |
| -| onStepExit | `function` | | Callback that fires when the top or bottom edge of a step exits the offset threshold. | |
147 |
| -| onStepProgress | `function` | | Callback that fires the progress a step has made through the threshold. | |
148 |
| -| debug | `boolean` | false | Whether to show visual debugging tools. | |
| 153 | +| Prop | Type | Default | Description | |
| 154 | +|----------------|------------------------------------------------------|---------|-----------------------------------------------------------------------------------------| |
| 155 | +| 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) | |
| 156 | +| threshold | `number` (greater than 1) | 4 | Granularity of the progress interval in pixels (smaller = more granular) | |
| 157 | +| onStepEnter | `function` | | Callback that fires when the top or bottom edge of a step enters the offset threshold. | |
| 158 | +| onStepExit | `function` | | Callback that fires when the top or bottom edge of a step exits the offset threshold. | |
| 159 | +| onStepProgress | `function` | | Callback that fires the progress a step has made through the threshold. | |
| 160 | +| debug | `boolean` | false | Whether to show visual debugging tools. | |
149 | 161 |
|
150 | 162 | The `onStepEnter` and `onStepExit` callbacks receive one argument, an object, with the following properties:
|
151 | 163 |
|
@@ -178,9 +190,9 @@ A `Step` element can contain one child, which must be a DOM element. To use a Re
|
178 | 190 |
|
179 | 191 | These are the props you can set on the `Step` component:
|
180 | 192 |
|
181 |
| -| Prop | Type | Default | Description | |
182 |
| -|------|------|---------|------------------------------------------------------------------| |
183 |
| -| data | any | | Data to be given to `<Scrollama>` callbacks when step triggered. | |
| 193 | +| Prop | Type | Default | Description | |
| 194 | +|------|---------|---------|------------------------------------------------------------------| |
| 195 | +| data | unknown | | Data to be given to `<Scrollama>` callbacks when step triggered. | |
184 | 196 |
|
185 | 197 | You will also probably want to set a `key` prop on each `Step` if you're transforming an array of data into a list of `Step` elements (see [Lists and Keys](https://reactjs.org/docs/lists-and-keys.html)).
|
186 | 198 |
|
|
0 commit comments