All Projects → sandstreamdev → React Swipeable List

sandstreamdev / React Swipeable List

Licence: mit
Swipeable list component for React.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to React Swipeable List

Slip
Slip.js — UI library for manipulating lists via swipe and drag gestures
Stars: ✭ 2,421 (+2715.12%)
Mutual labels:  list, swipe
Vue Picture Swipe
🖼 Vue Picture Swipe Gallery (a gallery of image with thumbnails, lazy-load and swipe) backed by photoswipe
Stars: ✭ 322 (+274.42%)
Mutual labels:  swipe, component
Vue Ydui
A mobile components Library with Vue2.js. 一只基于Vue2.x的移动端组件库。
Stars: ✭ 2,798 (+3153.49%)
Mutual labels:  mobile, component
Slider
Touch swipe image slider/slideshow/gallery/carousel/banner mobile responsive bootstrap
Stars: ✭ 2,046 (+2279.07%)
Mutual labels:  mobile, swipe
Swiper
Most modern mobile touch slider with hardware accelerated transitions
Stars: ✭ 29,519 (+34224.42%)
Mutual labels:  mobile, swipe
Swipelayout
A library what allows you to execute a swipe for the android platform
Stars: ✭ 150 (+74.42%)
Mutual labels:  list, swipe
Mint Ui
Mobile UI elements for Vue.js
Stars: ✭ 16,471 (+19052.33%)
Mutual labels:  mobile, component
React Swipeable
React swipe event handler hook
Stars: ✭ 1,348 (+1467.44%)
Mutual labels:  mobile, swipe
React Scrollbars Custom
The best React custom scrollbars component
Stars: ✭ 576 (+569.77%)
Mutual labels:  customizable, component
Cp Design
A configurable Mobile UI Components(React hooks+Typescript+Scss)组件库
Stars: ✭ 465 (+440.7%)
Mutual labels:  mobile, component
React Responsive Carousel
React.js Responsive Carousel (with Swipe)
Stars: ✭ 1,962 (+2181.4%)
Mutual labels:  mobile, swipe
Any Ui
❄️ 一个移动端组件库
Stars: ✭ 58 (-32.56%)
Mutual labels:  mobile, component
Calendar
📆 calendar 日历
Stars: ✭ 119 (+38.37%)
Mutual labels:  mobile, component
React Native List Popover
Popover to render a selectable list
Stars: ✭ 168 (+95.35%)
Mutual labels:  list, component
Vuetify Swipeout
👆 A swipe out example built with Vue CLI 3 + Vuetify + Swiper.
Stars: ✭ 117 (+36.05%)
Mutual labels:  mobile, swipe
Cupertino Pane
🎉📱Multi-functional panes and boards for next generation progressive applications
Stars: ✭ 267 (+210.47%)
Mutual labels:  mobile, swipe
React Swipeable Bottom Sheet
A swipeable material's bottom sheet implementation, using react-swipeable-views
Stars: ✭ 106 (+23.26%)
Mutual labels:  swipe, component
React Swipeable Views
A React component for swipeable views. ❄️
Stars: ✭ 4,095 (+4661.63%)
Mutual labels:  swipe, component
Swipe
Swipe is the most accurate touch slider. Support both React and Angular.
Stars: ✭ 850 (+888.37%)
Mutual labels:  mobile, swipe
React Easy Swipe
Easy handler for common swipe operations
Stars: ✭ 85 (-1.16%)
Mutual labels:  mobile, swipe

react-swipeable-list

Swipeable list component for React.

DemoInstallationUsageContributors


Actions Status 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')
    }}
    onSwipeProgress={progress => console.info(`Swipe progress: ${progress}%`)}
  >
    <div>Item name</div>
  </SwipeableListItem>
</SwipeableList>

or use function as children pattern if other container is needed (check animation and styled container examples). Note that in this case you need to provide list wrapper and pass default className props to have same behaviour. Default SwipeableList styles are passed in className prop.

<SwipeableList>
  {({ className, ...rest }) => (
    <div className={className}>
      <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')
        }}
        {...rest}
      >
        <div>Item name</div>
      </SwipeableListItem>
    </div>
  )}
</SwipeableList>

SwipeableList Props

scrollStartThreshold

Type: number (optional, 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 (optional, 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 (optional, 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 (optional, default: false)

If set to true all defined swipe actions are blocked.

swipeLeft

Type: Object (optional)

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

{
  action,  // required: swipe action (function)
  actionAnimation, // optional: type of animation
  content, // required: HTML or React component
}

action

Type: function (required)

Callback function that should be run when swipe is done beyond threshold.

actionAnimation

Type: ActionAnimations (RETURN | REMOVE | NONE) (optional, default: RETURN)

Animation type to be played swipe is done beyond threshold.

content

Type: Anything that can be rendered (required)

Content that is revealed when swiping.

swipeRight

Type: Object

Same as swipeLeft but to right. 😉

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 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)

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 SwipeableList. Value from the SwipeableListItem takes precedence.

onSwipeStart

Type: () => void

Fired after swipe has started (after drag gesture passes the swipeStartThreshold distance in pixels).

onSwipeEnd

Type: () => void

Fired after swipe has ended.

onSwipeProgress

Type: (progress: number) => void

Fired every time swipe progress changes. The reported progress value is always an integer in range 0 to 100 inclusive.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


sandstreamdevelopment

💼 💵 🤔

Marek Rozmus

💻 📖 ⚠️ 💡 🤔

jakubbogacz

👀 🤔 📖

Lukas Marx

🤔

Luis Filipe Pedroso

🐛

Przemysław Zalewski

🚧 👀 💻 🤔

MarkTension

🐛

wildeyes

🐛

Der Uli im Netz

🐛 🤔

Iliyaz syed

🐛

James Cuénod

🤔

Akshar Takle

🤔

Mohammed Faragallah

🤔

David

🤔

Karol Ziąbski

🤔

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].