1.0.0 • Published 1 year ago
rn-draggable-component v1.0.0
rn-draggable-component
rn-draggable-component
is a React Native component that provides drag and drop functionality for its child components. It utilizes the PanResponder and Animated modules to enable smooth and interactive drag and drop gestures.
Installation
npm install rn-draggable-component
Usage
Import rn-draggable-component in your React Native project:
import DragAndDropCard from 'rn-draggable-component';
Use it in your component:
<DragAndDropCard>
{/* Your content goes here */}
</DragAndDropCard>
Example
import React from 'react';
import { View, StyleSheet, Text } from 'react-native';
import DragAndDropCard from 'rn-draggable-component';
const App = () => {
return (
<View style={styles.container}>
<DragAndDropCard>
<Text style={styles.cardText}>Drag me!</Text>
</DragAndDropCard>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
cardText: {
fontSize: 18,
fontWeight: 'bold',
},
});
export default App;
1.0.0
1 year ago