
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
react-swipe-down-refresh
Advanced tools
Swipe down to refresh or pull-to-refresh control for mobile web applications.
The component is built using composable utilities to give fine grain control over the swipe-refresh behavior. These building blocks could be used independently to build your own swipe-refresh control.
SwipeRefreshList—React component with swipe-refresh behavioruseSwipeRefresh—React hook that encapsulates the swipe-refresh logicSwipeRefreshCoordinator—UI framework agnostic implementation of the core gesture handling logicTo start using react-swipe-down-refresh, install it via NPM
npm i react-swipe-down-refresh
# yarn
yarn add react-swipe-down-refresh
Open in a mobile web-browser or toggle the device mode on a web-browser
Try the app online here.
Import the SwipeRefreshList component and include the styles provided in the package to get the swipe-refresh behavior.
Make sure your build system supports importing .css files.
import { SwipeRefreshList } from "react-swipe-down-refresh";
// include the styles
import "react-swipe-down-refresh/lib/styles.css";
export default function App() {
const onRefreshRequested = () => {
return new Promise<void>((resolve) => {
setTimeout(() => resolve(), 3000);
});
};
return (
<div>
<SwipeRefreshList onRefresh={onRefreshRequested}>
<div className="item">Line 1</div>
<div className="item">Line 2</div>
<div className="item">Line 3</div>
</SwipeRefreshList>
</div>
);
}
| Name | Description | Required | Default |
|---|---|---|---|
| onRefresh | Callback function triggered on refresh | true | - |
| disabled | Disabled pull to refresh | false | false |
| className | CSS class to attache to the outermost div | false | - |
You can customize the swipe refresh spinner look and behavior via the following the props
| Name | Description | Required | Default |
|---|---|---|---|
| threshold | Minimum gesture movement displacement before swipe action is registered | false | false |
| onEndRefresh | Callback function triggered on refresh is complete | false | false |
| onStartRefresh | Callback function triggered on refresh start | false | false |
| slingshotDistance | The distance the refresh indicator can be pulled during a swipe gesture | false | false |
| progressViewOffset | The refresh indicator position during refresh | false | false |
| progressStrokeColor | Color of the refresh progress spinner | false | false |
| getScrollTopOverride | Disabled pull to refresh | false | false |
| overrideBrowserRefresh | Override browser pull to refresh behaviour | false | false |
| progressBackgroundColor | Background color of the progress spinner | false | false |
FAQs
React swipe down to refresh component
We found that react-swipe-down-refresh 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.