mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-05-17 05:29:41 +03:00
improve documentation
This commit is contained in:
@@ -47,7 +47,7 @@ I created this plugin because I hate ugly and space consuming scrollbars. Simila
|
||||
|
||||
## Getting started
|
||||
|
||||
### npm & Node
|
||||
### npm & node
|
||||
OverlayScrollbars can be downloaded from [npm](https://www.npmjs.com/package/overlayscrollbars) or the package manager of your choice:
|
||||
```sh
|
||||
npm install overlayscrollbars
|
||||
@@ -58,6 +58,8 @@ import 'overlayscrollbars/overlayscrollbars.css';
|
||||
import { OverlayScrollbars } from 'overlayscrollbars';
|
||||
```
|
||||
|
||||
> __Note__: In older node versions use `'overlayscrollbars/styles/overlayscrollbars.css'` as the import path for the CSS file.
|
||||
|
||||
### Manual download & embedding
|
||||
|
||||
<details>
|
||||
|
||||
@@ -14,16 +14,16 @@ export type UseOverlayScrollbarsInstance = () => OverlayScrollbars | null;
|
||||
* @param events OverlayScrollbars events.
|
||||
* @returns A tuple with two values:
|
||||
* The first value is the initialization function.
|
||||
* The second value is an function which returns the current OverlayScrollbars instance or null if not initialized.
|
||||
* The second value is a function which returns the current OverlayScrollbars instance or null if not initialized.
|
||||
*/
|
||||
export const useOverlayScrollbars = (
|
||||
options?: PartialOptions,
|
||||
events?: EventListeners
|
||||
): [UseOverlayScrollbarsInitialization, UseOverlayScrollbarsInstance] => {
|
||||
const osInstanceRef = useRef<OverlayScrollbars | null>(null);
|
||||
const offInitialEventsRef = useRef<(() => void) | void>();
|
||||
const optionsRef = useRef<PartialOptions>();
|
||||
const eventsRef = useRef<EventListeners>();
|
||||
const offInitialEventsRef = useRef<(() => void) | void>();
|
||||
|
||||
useEffect(() => {
|
||||
const { current: instance } = osInstanceRef;
|
||||
|
||||
@@ -47,7 +47,7 @@ I created this plugin because I hate ugly and space consuming scrollbars. Simila
|
||||
|
||||
## Getting started
|
||||
|
||||
### npm & Node
|
||||
### npm & node
|
||||
OverlayScrollbars can be downloaded from [npm](https://www.npmjs.com/package/overlayscrollbars) or the package manager of your choice:
|
||||
```sh
|
||||
npm install overlayscrollbars
|
||||
@@ -58,6 +58,8 @@ import 'overlayscrollbars/overlayscrollbars.css';
|
||||
import { OverlayScrollbars } from 'overlayscrollbars';
|
||||
```
|
||||
|
||||
> __Note__: In older node versions use `'overlayscrollbars/styles/overlayscrollbars.css'` as the import path for the CSS file.
|
||||
|
||||
### Manual download & embedding
|
||||
|
||||
<details>
|
||||
|
||||
Reference in New Issue
Block a user