0.0.2 • Published 1 year ago

react-native-swipe-row-fork-expo v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@nghinv/react-native-swipe-row

React Native Swipe Row Component use reanimated library


CircleCI Version MIT License All Contributors PRs Welcome

Installation

yarn add @nghinv/react-native-swipe-row

or

npm install @nghinv/react-native-swipe-row
  • peerDependencies
yarn add react-native-gesture-handler react-native-reanimated

Usage

import React from 'react';
import { View, Text, StyleSheet } from 'react-native';
import SwipeRow from '@nghinv/react-native-swipe-row';

function App() {
  return (
    <View style={styles.container}>
      <SwipeRow
        left={[
          { title: 'Delete', backgroundColor: 'tomato' },
          { title: 'Edit', icon: { name: 'delete' } },
        ]}
        right={[
          {
            title: 'Edit',
            titleColor: 'blue',
            backgroundColor: '#b388ff',
            icon: { name: 'edit' },
          },
          {
            title: 'Delete',
            backgroundColor: 'tomato',
            icon: { name: 'delete' },
          },
        ]}
        style={{ marginVertical: 1 }}
      >
        <View style={styles.row}>
          <Text>Swipe Row</Text>
        </View>
      </SwipeRow>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    paddingVertical: 24,
  },
  row: {
    height: 44,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: 'steelblue',
  }
});

export default App;

Property

PropertyTypeDefaultDescription
leftArray<ActionType>undefined
rightArray<ActionType>undefined
childrenReact.ReactNodeundefined
styleViewStyleundefined
buttonWidthnumber75
autoClosebooleantrue
onPress() => voidundefined
onSwipe(value: number) => voidundefined
activeRowAnimated.SharedValue<number>undefined
rowIndexnumber-1
disabledbooleanfalse
  • ActionType
PropertyTypeDefaultDescription
iconIconPropsTypeundefined
titlestringundefined
titleColorstringundefined
titleStyleTextStyleundefined
onPress() => voidundefined
backgroundColorstringundefined

Credits