Skip to content

Commit 9cf2755

Browse files
committed
chore: docs
1 parent bf4d092 commit 9cf2755

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

.storybook/preview.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export const parameters = {
2+
options: {
3+
storySort: { order: ['Introduction', 'Main', 'More'] },
4+
viewMode: 'docs',
5+
},
6+
};

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# react-smooth-scroll-hook
1+
# [react-smooth-scroll-hook](https://github.com/ron0115/react-smooth-scroll-hook)
22

3-
The `useSmoothScroll` hook finish smooth scroll behaviour in react component by `requestAnimationFrame`.
3+
[![GitHub license](https://img.shields.io/github/license/ron0115/react-smooth-scroll-hook?style=flat)](https://github.com/ron0115/react-smooth-scroll-hook/blob/master/LICENSE)
4+
[![npm version](http://img.shields.io/npm/v/react-smooth-scroll-hook.svg?style=flat)](https://npmjs.org/package/react-smooth-scroll-hook)
5+
[![GitHub stars](https://img.shields.io/github/stars/ron0115/react-smooth-scroll-hook?style=flat)](https://github.com/ron0115/react-smooth-scroll-hook/stargazers)
46

5-
**Examples are <a target="_blank" href="https://ron0115.best/react-smooth-scroll-hook/?path=/docs/hook-usesmoothscroll--docs" >Here</a>.**(Storybook)
7+
The `useSmoothScroll` hook finish smooth scroll behaviour in react component by `requestAnimationFrame`.
68

7-
**Live demo is <a target="_blank" href="https://codesandbox.io/s/reverent-cerf-ks4xh?file=/index.tsx" >Here</a>.**(Codesandbox)
9+
**Storybook Docs are <a target="_blank" href="https://ron0115.best/react-smooth-scroll-hook/?path=/docs/main-usesmoothscroll--docs" >Here</a>.**
810

911
## Feature
1012

@@ -22,7 +24,9 @@ npm install react-smooth-scroll-hook
2224

2325
## useSmoothScroll
2426

25-
### Basic Usage
27+
**Live demo is <a target="_blank" href="https://codesandbox.io/s/usesmoothscroll-2zt20?file=/Body.stories.tsx" >Here</a>.**(Codesandbox)
28+
29+
### Quick Start
2630

2731
```tsx
2832
import React, { useRef } from 'react';
@@ -93,6 +97,10 @@ export const Demo = () => {
9397

9498
Proviede a `list` of dom like below, and pass the parent container `ref` to hook, it return the scrollbar current state of `scrollTop`, `curIndex`, `curItem`.
9599

100+
**Live demo is <a target="_blank" href="https://codesandbox.io/s/gifted-field-5b3ui?file=/UseScrollWatch.stories.tsx:9-24" >Here</a>.**(Codesandbox)
101+
102+
### Quick Start
103+
96104
```tsx
97105
export const ScrollConatainerMode = () => {
98106
const ref = useRef<HTMLDivElement>(null);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"test": "tsdx test --passWithNoTests",
2222
"lint": "tsdx lint",
2323
"prepare": "tsdx build",
24-
"storybook": "start-storybook -p 6006",
24+
"storybook": "start-storybook -p 6006 --docs",
2525
"build-storybook": "build-storybook --docs",
2626
"deploy-storybook": "storybook-to-ghpages",
2727
"release": "semantic-release"

0 commit comments

Comments
 (0)