Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
react-scroll-to-top
Advanced tools
A simple button component that scrolls to the top of the page when pressed\ The button is only visible when a certain height has been reached on the page\
A simple button component that scrolls to the top of the page when pressed
The button is only visible when a certain height has been reached on the page\
Run npm i react-scroll-to-top
Import the module and it's stylesheet
Include <ScrollToTop />
anywhere in your render/return function:
import ScrollToTop from "react-scroll-to-top";
import "react-scroll-to-top/lib/index.css"
function CoolPage() {
return (
<div>
<ScrollToTop />
<h1>Hello, world!</h1>
</div>
);
}
Prop | Type | Description | Default |
---|---|---|---|
top | number | The height where the button gets visible | 20 |
color | string | The arrow color | black |
bgColor | string | Button background color | white |
className | string | Custom classname to add your own styling | '' |
style | Object | Object to override styling | |
smooth | boolean | Whether to use smooth scrolling* | false |
Smooth scrolling uses a newer window.scrollTo
implementation.
Check out its support in browsers at MDN web docs.
Written in TypeScript, no need for @types installation
FAQs
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
The npm package react-scroll-to-top receives a total of 4,410 weekly downloads. As such, react-scroll-to-top popularity was classified as popular.
We found that react-scroll-to-top demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.