Skip to content

Commit 0de7fc2

Browse files
authored
Update README.md
1 parent c2e2713 commit 0de7fc2

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

README.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
[![Build Status](https://travis-ci.org/icd2k3/react-scroll-into-view-if-needed.svg?branch=master)](https://travis-ci.org/icd2k3/react-scroll-into-view-if-needed)
22
[![Coverage Status](https://coveralls.io/repos/github/icd2k3/react-scroll-into-view-if-needed/badge.svg)](https://coveralls.io/github/icd2k3/react-scroll-into-view-if-needed)
33

4-
## Description
5-
64
A thin react component wrapper bundled with the fantastic [scroll-into-view-if-needed](https://www.npmjs.com/package/scroll-into-view-if-needed) [ponyfill](https://ponyfill.com).
75

86
## Install
@@ -39,6 +37,24 @@ The standalone version does **not** come bundled with [scroll-into-view-if-neede
3937

4038
`import ScrollIntoViewIfNeeded from 'react-scroll-into-view-if-needed/dist/umd/standalone.js'`
4139

40+
41+
## Props
42+
43+
#### options
44+
> Type: `object`
45+
> Default: `{ behavior: 'smooth', scrollMode: 'if-needed' }`
46+
> Full list of options [here](https://www.npmjs.com/package/scroll-into-view-if-needed#api)
47+
48+
The `options` prop simply passes options to `scroll-into-view-if-needed`. See all the possible options in their [API documentation](https://www.npmjs.com/package/scroll-into-view-if-needed#api).
49+
50+
```js
51+
<ScrollIntoViewIfNeeded options={{
52+
scrollMode: 'always',
53+
}}>
54+
<div>Hello</div>
55+
</ScrollIntoViewIfNeeded>
56+
```
57+
4258
#### active
4359
> Type: `boolean`
4460
> Default: `true`
@@ -71,21 +87,6 @@ class Example extends React.PureComponent {
7187
}
7288
```
7389

74-
#### options
75-
> Type: `object`
76-
> Default: `{ behavior: 'smooth', scrollMode: 'if-needed' }`
77-
> Full list of options [here](https://www.npmjs.com/package/scroll-into-view-if-needed#api)
78-
79-
The `options` prop simply passes options to `scroll-into-view-if-needed`. See all the possible options in their [API documentation](https://www.npmjs.com/package/scroll-into-view-if-needed#api).
80-
81-
```js
82-
<ScrollIntoViewIfNeeded options={{
83-
scrollMode: 'always',
84-
}}>
85-
<div>Hello</div>
86-
</ScrollIntoViewIfNeeded>
87-
```
88-
8990
#### elementType
9091
> Type: `string`
9192
> Default: `'div'`

0 commit comments

Comments
 (0)