All Projects → Naturalclar → react-native-swipe-list

Naturalclar / react-native-swipe-list

Licence: MIT License
Swipeable FlatList Component for react-native

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to react-native-swipe-list

react-native-dual
ScrollView, FlatList, SectionList and ListView with dual background
Stars: ✭ 28 (+27.27%)
Mutual labels:  listview, flatlist
InfiniteScroll
You can do a Endless scroll in ListView or RecyclerView with simple steps, with a listener for do request to your web service.
Stars: ✭ 28 (+27.27%)
Mutual labels:  listview
imgui
Dear ImGui Addons Branch = plain unmodified dear imgui plus some extra addon.
Stars: ✭ 348 (+1481.82%)
Mutual labels:  listview
Swipeable-View
Simple editActionsForRowAt functionality, written on SWIFTUI
Stars: ✭ 37 (+68.18%)
Mutual labels:  swipeable
react-native-paginated-listview
A simple paginated react-native ListView with a few customization options
Stars: ✭ 14 (-36.36%)
Mutual labels:  listview
huge listview
A performant list with any number of items.
Stars: ✭ 21 (-4.55%)
Mutual labels:  listview
cgridlistctrlex
MFC Grid control using a custom draw CListCtrl with subitem editing and formatting
Stars: ✭ 80 (+263.64%)
Mutual labels:  listview
android-page
android 分页列表数据加载引擎,主要封装了android分页列表数据加载的各个组件,如果你有一个需要分页加载的List列表,都可以使用此框架实现。
Stars: ✭ 15 (-31.82%)
Mutual labels:  listview
react-native-masonry-brick-list
Staggered Or Masonary List View For React Native Written in pure js
Stars: ✭ 24 (+9.09%)
Mutual labels:  listview
recycler-adapter
RecyclerView-driven declarative UIs
Stars: ✭ 124 (+463.64%)
Mutual labels:  listview
GenericAdapter
⛳️ Easy to use android databinding ready recyclerview adapter
Stars: ✭ 26 (+18.18%)
Mutual labels:  listview
react-native-nested-listview
A UI component for React Native for representing nested arrays of N levels
Stars: ✭ 163 (+640.91%)
Mutual labels:  listview
GenericRecyclerAdapter
Easiest way to use RecyclerView. Reduce boilerplate code! You don't need to write adapters for listing pages anymore!
Stars: ✭ 53 (+140.91%)
Mutual labels:  listview
LimitlessUI
Awesome C# UI library that highly reduced limits of your application looks
Stars: ✭ 41 (+86.36%)
Mutual labels:  listview
kandy
Sweet Android libraries written in Kotlin
Stars: ✭ 19 (-13.64%)
Mutual labels:  listview
react-native-card-list
A React Native component which displays a list of image cards that zoom to fullscreen
Stars: ✭ 19 (-13.64%)
Mutual labels:  listview
RNApp
react native app
Stars: ✭ 43 (+95.45%)
Mutual labels:  flatlist
react-native-nlist
原生Listview Native lListView react-native encapsulation Memory recovery reusing High performance
Stars: ✭ 60 (+172.73%)
Mutual labels:  listview
react-native-bidirectional-infinite-scroll
📜 React Native - Bidirectional Infinite Smooth Scroll
Stars: ✭ 137 (+522.73%)
Mutual labels:  flatlist
vue-virtual-stream
Simple vue-virtualized package for Vue.js
Stars: ✭ 16 (-27.27%)
Mutual labels:  listview

react-native-swipe-list

Build Status Version Supports iOS and Android MIT License

An FlatList Component that is swipeable.

This was originally a fork of an experimental component SwipeableFlatList which was removed from the react-native core.

Demo

Install

In order to use this package, you will also need to install react-native-gesture-handler to your project.

yarn add react-native-swipe-list react-native-gesture-handler

Usage

import React, { useState } from 'react';
import { LayoutAnimation, SafeAreaView, StyleSheet } from 'react-native';
import {
  SwipeableFlatList,
  SwipeableQuickActionButton,
  SwipeableQuickActions,
} from 'react-native-swipe-list';
import { ListItem } from './ListItem';
const styles = StyleSheet.create({
  container: { flex: 1 },
});

const initialData = [...Array(30)].map((_, index) => ({
  id: index,
  text: `Item ${index}`,
}));

export const TestModule = () => {
  const [data, setData] = useState(initialData);

  return (
    <SafeAreaView style={styles.container}>
      <SwipeableFlatList
        data={data}
        renderItem={({ item }) => <ListItem {...item} />}
        keyExtractor={index => index.id}
        renderLeftActions={({ item }) => (
          <SwipeableQuickActions>
            <SwipeableQuickActionButton
              onPress={() => {
                LayoutAnimation.configureNext(
                  LayoutAnimation.Presets.easeInEaseOut,
                );
                setData(data.filter(value => value !== item.album));
              }}
              text="delete"
              textStyle={{ fontWeight: 'bold', color: 'white' }}
            />
          </SwipeableQuickActions>
        )}
        renderRightActions={({ item }) => (
          <SwipeableQuickActions>
            <SwipeableQuickActionButton onPress={() => {}} text="Other" />
            <SwipeableQuickActionButton onPress={() => {}} text="Flag" />
            <SwipeableQuickActionButton onPress={() => {}} text="Archive" />
          </SwipeableQuickActions>
        )}
      />
    </SafeAreaView>
  );
};

Reference

Props

SwipeableFlatList takes in FlatListProps as well as the following props:

renderLeftActions

Views to be displayed when user swipes the item from the left side.

Type Required
(info: ListRenderItemInfo) => React.ReactNode No

renderRightActions

Views to be displayed when user swipes the item from the right side.

Type Required
(info: ListRenderItemInfo) => React.ReactNode No

closeOnScroll

When true, swiped view will close when user scrolls. Default is true

Type Required
boolean No

License

The library is released under the MIT license. For more information see LICENSE.

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