
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-snap-scroll
Advanced tools
A React.js Component for "snap" scrolling between elements.
npm install react-snap-scroll --save
// Or
yarn add react-snap-scroll
import ReactSnapScroll from 'react-snap-scroll';
const App = () => (
<ReactSnapScroll transition="move-top-bottom">
<div />
<div />
<div />
</ReactSnapScroll>
);
The examples folder contains an example use with create-react-app.
cd examples
yarn
yarn start
| Property | Type | Default | Description |
|---|---|---|---|
children | node, arrayOf(node) | isRequired | The elements to snap between. |
start | number | 0 | The starting index of the Snapper. |
indexChanged | func | f => f | Callback function when the Snapper changes indexes. |
transition | string | "move-top-bottom" | The transition to apply on index changed. |
orientation | string | "vertical" | The orientation of a scroll/swipe necessary to trigger an index change. |
customTransition | string | null | A custom classname to use for the CSSTransition instead of one of the default animations. |
customDuration | object | { enter: 1000, exit: 1000 } | The timeout duration applied to the CSSTransition to manipulate the classes applied to the transitioning elements. |
These transitions come from here.
If you're using the customTransition prop it is assumed you know your way around react-transition-group and its Component CSSTransition. The string defined in the customTransition prop will be suffixed with 'forward' and 'reverse' in order to create separate transitions in either direction.
Ex:
customTransition="my-transition"
Classnames applied to the element that is appearing:
.my-transition-forward-enter.my-transition-forward-enter-active.my-transition-forward-enter-done.my-transition-reverse-enter.my-transition-reverse-enter-active.my-transition-reverse-enter-doneClassnames applied to the element that is leaving:
.my-transition-forward-exit.my-transition-forward-exit-active.my-transition-forward-exit-done.my-transition-reverse-exit.my-transition-reverse-exit-active.my-transition-reverse-exit-doneThe enter and exit properties of the customDuration object will be applied to the timeout prop in CSSTransition. These values should match up with the animation duration + delay for the respective animation.
FAQs
A container to handle 'snap scrolling' behaviour.
We found that react-snap-scroll 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.