New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sandstreamdev/react-swipeable-list

Package Overview
Dependencies
Maintainers
4
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sandstreamdev/react-swipeable-list

Swipeable list component for React

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
844
decreased by-63.48%
Maintainers
4
Weekly downloads
 
Created
Source

react-swipeable-list

Swipeable list component for React.

DemoInstallationUsageContributors


Actions Status Greenkeeper badge codecov GitHub Release Date All Contributors

React Swipeable List component

A control to render list with swipeable items. Items can have action on left and right swipe. Swipe action triggering can be configured.

Demo

Check working example page or experiment on:

Edit react-swipeable-list

Installation

npm install @sandstreamdev/react-swipeable-list
# or via yarn
yarn add @sandstreamdev/react-swipeable-list

Usage

import { SwipeableList, SwipeableListItem } from '@sandstreamdev/react-swipeable-list';
import '@sandstreamdev/react-swipeable-list/dist/styles.css';

<SwipeableList>
  <SwipeableListItem
    swipeLeft={{
      content: <div>Revealed content during swipe</div>,
      action: () => console.info('swipe action triggered')
    }}
    swipeRight={{
      content: <div>Revealed content during swipe</div>,
      action: () => console.info('swipe action triggered')
    }}
  >
    <div>Item name</div>
  </SwipeableListItem>
</SwipeableList>

NOTE: SwipeableListItem can be used without SwipeableList but swipe blocking on scroll needs to be handled.

SwipeableList Props

scrollStartThreshold

Type: number (default: 10)

How far in pixels scroll needs to be done to block swiping. After scrolling is started and goes beyond the threshold, swiping is blocked.

It can be set for the whole list or for every item. See scrollStartThreshold for SwipeableListItem. Value from the SwipeableListItem takes precedence.

swipeStartThreshold

Type: number (default: 10)

How far in pixels swipe needs to be done to start swiping on list item. After a swipe is started and goes beyond the threshold, scrolling is blocked.

It can be set for the whole list or for every item. See swipeStartThreshold for SwipeableListItem. Value from the SwipeableListItem takes precedence.

threshold

Type: number (default: 0.5)

How far swipe needs to be done to trigger attached action. 0.5 means that item needs to be swiped to half of its width, 0.25 - one-quarter of width.

It can be set for the whole list or for every item. See threshold for SwipeableListItem. Value from the SwipeableListItem takes precedence.

SwipeableListItem Props

blockSwipe

Type: boolean (default: false)

If set to true all defined swipe actions are blocked.

swipeLeft

Type: Object

Data for defining left swipe action and rendering content after item is swiped. The object requires following structure:

{
  action,  // required: swipe action (function)
  content, // required: HTML or React component
}

swipeRight

Type: Object

Same as swipeLeft but to right. :wink:

scrollStartThreshold

Type: number (default: 10)

It can be set for the whole list or for every item. See scrollStartThreshold for SwipeableList. Value from the SwipeableListItem takes precedence.

swipeStartThreshold

Type: number (default: 10)

How far in pixels swipe needs to be done to start swiping on list item. After a swipe is started and goes beyond the threshold, scrolling is blocked.

It can be set for the whole list or for every item. See swipeStartThreshold for SwipeableList. Value from the SwipeableListItem takes precedence.

threshold

Type: number (default: 0.5)

It can be set for the whole list or for every item. See threshold for SwipeableList. Value from the SwipeableListItem takes precedence.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

sandstreamdevelopment
sandstreamdevelopment

💼 💵 🤔
Marek Rozmus
Marek Rozmus

💻 📖 ⚠️ 💡 🤔
jakubbogacz
jakubbogacz

👀 🤔 📖
Lukas Marx
Lukas Marx

🤔
Luis Filipe Pedroso
Luis Filipe Pedroso

🐛
Przemysław Zalewski
Przemysław Zalewski

🚧 👀
MarkTension
MarkTension

🐛
wildeyes
wildeyes

🐛

This project follows the all-contributors specification. Contributions of any kind welcome!

Keywords

FAQs

Package last updated on 05 Dec 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc