# react-simple-scroll-up

> A minimal lightweight react component for adding a nice scroll up (back to top) button with onScroll progress.

Latest version **0.2.3** (published 2022-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-simple-scroll-up
pnpm add react-simple-scroll-up
yarn add react-simple-scroll-up
bun add react-simple-scroll-up
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.3 |
| Published | 2022-09-18 |
| First published | 2021-10-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14 |
| Dependencies | 0 |
| Unpacked size | 13.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | awran5 |
| Maintainers | awran5 |
| Keywords | react, react component, to top, scroll up, on scroll progess |

## Links

- npm: https://www.npmjs.com/package/react-simple-scroll-up
- Repository: https://github.com/awran5/react-simple-scroll-up
- Homepage: https://github.com/awran5/react-simple-scroll-up#readme
- Issues: https://github.com/awran5/react-simple-scroll-up/issues
- npm.io page: https://npm.io/package/react-simple-scroll-up

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.2.3 (latest) — 2022-09-18
- 0.2.1 — 2022-09-18
- 0.2.0 — 2021-11-09
- 0.1.0 — 2021-10-28

## README

# React Simple Scroll up (back to top)

> A minimal lightweight react component for adding a nice scroll up (back to top) with onScroll progress.

[![NPM](https://img.shields.io/npm/v/react-simple-scroll-up.svg)](https://www.npmjs.com/package/react-simple-scroll-up) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)![npm bundle size](https://img.shields.io/bundlephobia/min/react-simple-scroll-up)![GitHub](https://img.shields.io/github/license/awran5/react-simple-scroll-up)

<p align="center">
  <img src="./screenshot.gif" alt="screenshot" width="100%" />
</p>

## Install

#### npm

```sh
npm i react-simple-scroll-up
```

#### Yarn

```sh
yarn add react-simple-scroll-up
```

---

### Examples

```jsx
import React from 'react'
import { ScrollToTop } from 'react-simple-scroll-up'

const MyComponent = () => {
  return (
    <div className='App'>
      <ScrollToTop {/* Props */} />
    </div>
  )
}
```

<br />

## Props

| Prop               | Type                | Options  | Description                                                                                                                        | Default                  |
| ------------------ |:-------------------:| -------- | ---------------------------------------------------------------------------------------------------------------------------------- |:------------------------:|
| `size`             | number              | Optional | Set button width and height (in pixels)                                                                                            | `50`                     |
| `offsetTop`        | number              | Optional | Show button after number of pixels that document has scrolled vertically                                                           | `100`                    |
| `bgColor`          | string              | Optional | Button background color                                                                                                            | `rgb(0 0 0 / 75%)`       |
| `strokeWidth`      | number              | Optional | Scroll progess bar width (in pixels)                                                                                               | `4`                      |
| `strokeFillColor`  | string              | Optional | Scroll progess bar fill color                                                                                                      | `rgb(0 0 0 / 50%)`       |
| `strokeEmptyColor` | string              | Optional | Scroll progess bar empty color                                                                                                     | `rgb(200 200 200 / 85%)` |
| `symbol`           | string or ReactNode | Optional | Use any HTML [Symbols](https://unicode-table.com/en/2B99/) by simply _copy/paste_ it OR any custom element, e.g. `FontAwesomeIcon` | `🡩`                     |
| `symbolSize`       | number              | Optional | Symbol font size (in pixels). Only applies when `symbol` is a string.                                                              | `20`                     |
| `symbolColor`      | string              | Optional | Symbol color.                                                                                                                      | `#fff`                   |
| `onScrolling`      | function            | Optional | Callback `function` that is triggered while scrolling with `value` passed                                                          | `-`                      |
| `onScrollEnd`      | function            | Optional | Callback `function` that is triggered when scroll is ended                                                                         | `-`                      |
| `className`        | string              | Optional | CSS class name                                                                                                                     | `to-top-progress`        |
| `style`            | React.CSSProperties | Optional | CSS style                                                                                                                          | `-`                      |

<br />

[![Edit react-simple-scroll-up](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/react-simple-scroll-up-with-progress-onscroll-dxobe?fontsize=14&hidenavigation=1&theme=dark)

### License

MIT © [awran5](https://github.com/awran5/)

---
_Source: https://npm.io/package/react-simple-scroll-up · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
