Gathering detailed insights and metrics for react-scroll-to-top
Gathering detailed insights and metrics for react-scroll-to-top
Gathering detailed insights and metrics for react-scroll-to-top
Gathering detailed insights and metrics for react-scroll-to-top
react-scroll-to-bottom
React container that will auto scroll to bottom
react-scroll-up
React component to render element for scroll to top of page
scroll-to-top-lib
[기깔나는 사람들] React-Scroll-To-Top-library
@xylabs/react-scroll-to-top
Common React library for all XY Labs projects that use React
npm install react-scroll-to-top
Typescript
Module System
Node Version
NPM Version
82.7
Supply Chain
85.8
Quality
75.9
Maintenance
100
Vulnerability
100
License
TypeScript (90.32%)
JavaScript (5.36%)
CSS (4.33%)
Total Downloads
1,385,173
Last Day
1,562
Last Week
7,026
Last Month
31,265
Last Year
493,060
63 Stars
27 Commits
12 Forks
2 Watching
17 Branches
3 Contributors
Minified
Minified + Gzipped
Latest Version
3.0.0
Package Id
react-scroll-to-top@3.0.0
Unpacked Size
16.48 kB
Size
6.22 kB
File Count
6
NPM Version
6.14.16
Node Version
14.19.0
Cumulative downloads
Total Downloads
Last day
-5.1%
1,562
Compared to previous day
Last week
-14.3%
7,026
Compared to previous week
Last month
-7.4%
31,265
Compared to previous month
Last year
2.9%
493,060
Compared to previous year
1
28
A lightweight and customizable button component that scrolls to the top of a page when pressed
The button is only visible once a certain height has been reached on the page
With npm:
npm i react-scroll-to-top
or with Yarn:
yarn add react-scroll-to-top
Import and then add <ScrollToTop />
at the bottom of your return function (for a11y reasons):
1import ScrollToTop from "react-scroll-to-top"; 2 3function CoolPage() { 4 return ( 5 <div> 6 <h1>Hello, world!</h1> 7 <div style={{ marginTop: "150vh" }} /> 8 <ScrollToTop smooth /> 9 </div> 10 ); 11}
Prop | Type | Description | Default |
---|---|---|---|
smooth | boolean | Whether to use smooth scrolling* | false |
top | number | Height after page scroll to be visible | 20 |
color | string | The SVG icon fill color | "black" |
svgPath | string | The SVG icon path d attribute | An arrow path |
width | string | The SVG icon width | "28" |
height | string | The SVG icon height | "28" |
viewBox | string | The SVG icon viewBox attribute | "0 0 256 256" |
component | any | Component to override SVG icon. See examples | |
style | Object | Object to add/override styling | |
className | string | Classname to add/override styling (note, !important for overrides might be needed) |
Smooth scrolling uses a newer window.scrollTo
implementation.
Check out its support in browsers at MDN web docs.
With custom SVG path
With custom SVG component
With custom DOM element
Written in TypeScript, no need for @types installation
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
Found 3/27 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
49 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More