Skip to content

Commit ec82b76

Browse files
committedFeb 25, 2018
docs(README): include module import description
1 parent 7dff9d3 commit ec82b76

File tree

2 files changed

+20
-4
lines changed

2 files changed

+20
-4
lines changed
 

‎README.md

+19-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,22 @@ If you want to make it works down to IE9, the only thing you need to do is to ad
2323
<!--[if IE 9]><script src="classList.min.js"></script><![endif]-->
2424
```
2525

26-
## RTL Support
26+
## Usage
2727

28-
Add `direction: rtl;` to your `<div>`'s CSS, and SimpleScrollbar will detect the direction automatically.
28+
You can use this library as a script tag, or you can import it as a npm module, eg:
29+
30+
### CommonJS
31+
32+
```js
33+
const SimpleScrollbar = require('simple-scrollbar');
34+
```
35+
36+
### ES2015 modules
37+
38+
```js
39+
import SimpleScrollbar from 'simple-scrollbar'
40+
```
2941

30-
## Usage
3142
### Auto-binding
3243
Include the attribute `ss-container` in any `<div>` that you want to make scrollable, and the library will turn it for you
3344

@@ -67,5 +78,10 @@ document.body.appendChild(otherDiv);
6778
SimpleScrollbar.initAll();
6879
```
6980

81+
82+
### RTL Support
83+
84+
Add `direction: rtl;` to your `<div>`'s CSS, and SimpleScrollbar will detect the direction automatically.
85+
7086
## Credits
7187
Inspired by yairEO's jQuery plugin ([fakescroll](https://github.com/yairEO/fakescroll))

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "simple-scrollbar",
3-
"version": "0.3.1",
3+
"version": "0.4.0",
44
"description": "Very simple vanilla javascript library for creating a custom scrollbar cross-browser and cross-devices.",
55
"main": "simple-scrollbar.js",
66
"repository": {

0 commit comments

Comments
 (0)