Skip to content

Commit 5fb2210

Browse files
committed
feat(*): initial version
0 parents  commit 5fb2210

28 files changed

+23696
-0
lines changed

.babelrc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/env",
5+
{
6+
"modules": false
7+
}
8+
],
9+
"@babel/react"
10+
]
11+
}

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.eslintrc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": ["prettier", "prettier/react"],
4+
"env": {
5+
"es6": true
6+
},
7+
"plugins": ["prettier", "react", "react-hooks"],
8+
"parserOptions": {
9+
"sourceType": "module"
10+
}
11+
}

.github/workflows/npmpublish.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish to npm
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- uses: actions/setup-node@v1
13+
with:
14+
node-version: 12
15+
- run: yarn
16+
- run: yarn test
17+
18+
publish-npm:
19+
needs: build
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v1
23+
- uses: actions/setup-node@v1
24+
with:
25+
node-version: 12
26+
registry-url: https://registry.npmjs.org/
27+
- run: yarn
28+
- run: npm publish
29+
env:
30+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
# See https://help.github.com/ignore-files/ for more about ignoring files.
3+
4+
# dependencies
5+
node_modules
6+
7+
# builds
8+
build
9+
dist
10+
.rpt2_cache
11+
12+
# misc
13+
.DS_Store
14+
.env
15+
.env.local
16+
.env.development.local
17+
.env.test.local
18+
.env.production.local
19+
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*

.npmignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.git
2+
yarn.lock
3+
rollup*
4+
.eslint*
5+
.babelrc
6+
.prettierrc
7+
.gitignore
8+
src
9+
example

.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"singleQuote": true,
3+
"trailingComma": "all"
4+
}

README.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# react-custom-scroller
2+
3+
[![NPM](https://img.shields.io/npm/v/react-custom-scroller.svg)](https://www.npmjs.com/package/react-custom-scroller) [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-success)](https://prettier.io)
4+
5+
Super simple React component for creating a custom scrollbar cross-browser and cross-devices.
6+
7+
### <img height="40px" src="./close.svg" />
8+
9+
Interested in working on projects like this? [Close](https://close.com) is looking for [great engineers](https://jobs.close.com) to join our team!
10+
11+
## Install
12+
13+
```bash
14+
yarn add react-custom-scroller
15+
```
16+
17+
## Benefits
18+
19+
- Extremely lightweight (less than 2KB minzipped).
20+
- It uses the native scroll events, so all the events work and are smooth (mouse wheel, space, page down, page up, arrows etc).
21+
- No other 3rd-party dependencies.
22+
- The performance is excellent!
23+
24+
## Usage
25+
26+
```jsx
27+
import React from 'react';
28+
import CustomScroller from 'react-custom-scroller';
29+
30+
const MyScrollableDiv = () => (
31+
<CustomScroller>Content goes here.</CustomScroller>
32+
);
33+
```
34+
35+
## License
36+
37+
MIT © [Close](https://github.com/closeio)

close.svg

+28
Loading

0 commit comments

Comments
 (0)