All Projects → jemise111 → React Native Swipe List View

jemise111 / React Native Swipe List View

Licence: mit
A React Native ListView component with rows that swipe open and closed

Programming Languages

javascript
184084 projects - #8 most used programming language
java
68154 projects - #9 most used programming language
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to React Native Swipe List View

React Native Action Sheet Component
React Native Action Sheet Component for iOS & Android.
Stars: ✭ 60 (-97.62%)
Mutual labels:  react-native-component
React Native Image Slider Box
A simple and fully customizable React Native component that implements an Image Slider UI.
Stars: ✭ 113 (-95.52%)
Mutual labels:  react-native-component
React Native Performance Monitor
React Native Performance Monitor - Realtime graphing of React Native render performance
Stars: ✭ 174 (-93.11%)
Mutual labels:  react-native-component
React Native Deck Swiper
tinder like react-native deck swiper
Stars: ✭ 1,261 (-50.04%)
Mutual labels:  react-native-component
React Native Slot Machine
Text slot machine for react-native
Stars: ✭ 109 (-95.68%)
Mutual labels:  react-native-component
React Native Thumbnail
Get thumbnail from local media. Currently, it only supports for video.
Stars: ✭ 122 (-95.17%)
Mutual labels:  react-native-component
React Arkit
AR library for React-Native based on ARKit
Stars: ✭ 57 (-97.74%)
Mutual labels:  react-native-component
React Native Side Menu
Side menu component for React Native
Stars: ✭ 2,214 (-12.28%)
Mutual labels:  react-native-component
React Native Push Notification Popup
A <NotificationPopup/> component for presenting your own push notification in react-native app
Stars: ✭ 111 (-95.6%)
Mutual labels:  react-native-component
React Native Timeline Flatlist
FlatList based timeline component for React Native for iOS and Android
Stars: ✭ 163 (-93.54%)
Mutual labels:  react-native-component
React Native Contacts
React Native Contacts
Stars: ✭ 1,369 (-45.76%)
Mutual labels:  react-native-component
React Native Barcode Scanner Google
Barcode scanner for react native, which implements barcode detection from Google's Vision API.
Stars: ✭ 105 (-95.84%)
Mutual labels:  react-native-component
React Native Draggable Grid
A draggable and sortable grid of react-native
Stars: ✭ 137 (-94.57%)
Mutual labels:  react-native-component
React Native Ios Context Menu
A react-native component to use context menu's (UIMenu) on iOS 13/14+
Stars: ✭ 80 (-96.83%)
Mutual labels:  react-native-component
React Native Simple Modal
A simple JavaScript modal component for React Native.
Stars: ✭ 179 (-92.91%)
Mutual labels:  react-native-component
React Native Modal Dropdown
A react-native dropdown/picker/selector component for both Android & iOS.
Stars: ✭ 1,103 (-56.3%)
Mutual labels:  react-native-component
React Native Design Utility
Utility for building design system in react-native. Idea from TailwindCSS
Stars: ✭ 116 (-95.4%)
Mutual labels:  react-native-component
React Native Beautiful Video Recorder
The video recorder component that extends from react-native-camera. It works for both iOS & Android.
Stars: ✭ 204 (-91.92%)
Mutual labels:  react-native-component
React Native Photos Framework
A modern and comprehensive CameraRoll/iCloud-library-API for React Native 📸 📹
Stars: ✭ 190 (-92.47%)
Mutual labels:  react-native-component
React Native Zoomable View
A view component for react-native with pinch to zoom, tap to move and double tap to zoom capability.
Stars: ✭ 152 (-93.98%)
Mutual labels:  react-native-component

npm npm

react-native-swipe-list-view



<SwipeListView> is a vertical ListView with rows that swipe open and closed. Handles default native behavior such as closing rows when ListView is scrolled or when other rows are opened.

Also includes <SwipeRow> if you want to use a swipeable row outside of the <SwipeListView>


🔥🔥 BREAKING CHANGES 🔥🔥

For use with RN 0.60+ please use [email protected]+

RN 0.60 and RNSLV 2.0.0 deprecate the use of ListView entirely, please see example.js for examples and see the migrating-to-flatlist doc for a migration guide if you aren't already using FlatList.

The useFlatList prop is no longer required, as FlatList is the default ListView used.


Example

Try it out! https://snack.expo.io/@jemise111/react-native-swipe-list-view

(What's a Snack?)

Installation

npm install --save react-native-swipe-list-view

Running the example

The application under ./SwipeListExample will produce the above example. To run execute the following:

  • git clone https://github.com/jemise111/react-native-swipe-list-view.git
  • cd react-native-swipe-list-view
  • cd SwipeListExample
  • yarn
  • cd ios
  • pod install
  • cd ..
  • react-native run-ios | react-native run-android

Android: If you get the following error SwipeListExample/android/app/debug.keystore' not found for signing config 'debug'.:

cd android/app/ && keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000
// answer the questions
cd ../..

Usage

import { SwipeListView } from 'react-native-swipe-list-view';

//... note: your data array objects MUST contain a key property 
//          or you must pass a keyExtractor to the SwipeListView to ensure proper functionality
//          see: https://reactnative.dev/docs/flatlist#keyextractor

  this.state.listViewData = Array(20)
    .fill("")
    .map((_, i) => ({ key: `${i}`, text: `item #${i}` }));

//...
render() {
    return (
        <SwipeListView
            data={this.state.listViewData}
            renderItem={ (data, rowMap) => (
                <View style={styles.rowFront}>
                    <Text>I am {data.item.text} in a SwipeListView</Text>
                </View>
            )}
            renderHiddenItem={ (data, rowMap) => (
                <View style={styles.rowBack}>
                    <Text>Left</Text>
                    <Text>Right</Text>
                </View>
            )}
            leftOpenValue={75}
            rightOpenValue={-75}
        />
    )
}

See example.js for full usage guide (including using <SwipeRow> by itself)

Note:

If your row is touchable (TouchableOpacity, TouchableHighlight, etc.) with an onPress function make sure renderItem returns the Touchable as the topmost element.

GOOD:

renderItem={ data => (
    <TouchableHighlight onPress={this.doSomething.bind(this)}>
        <View>
            <Text>I am {data.item} in a SwipeListView</Text>
        </View>
    </TouchableHighlight>
)}

BAD:

renderItem={ data => (
    <View>
        <TouchableHighlight onPress={this.doSomething.bind(this)}>
            <Text>I am {data.item} in a SwipeListView</Text>
        </TouchableHighlight>
    </View>
)}

Component APIs

<SwipeListView />

<SwipeRow />

Flatlist / SectionList support

SwipeListView now supports FlatList and SectionList! (as of v1.0.0)

Please see the migrating-to-flatlist doc for all details. And see example.js for a full usage example.

Also see docs/ for help with

And the examples/ folder for examples on

  • Swipe to Delete (also see "Actions" for an alternative way to achieve this)
  • Per Row Behavior
  • UI Based on Swipe Values
  • Actions

Core Support

RN Core added a SwipeList component as of v0.27.0 It is actively being worked on and has no documentation yet. So I will continue to maintain this component until a future date.

License

MIT

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].