Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
react-native-drag-and-drop-list
Advanced tools
Readme
The Drag and Drop List with Drop Box is an intuitive and user-friendly interface that allows users to easily organize and manage items by dragging them from a list and dropping them into a designated drop box.
with npm
npm install react-native-drag-and-drop-list
Take in consideration the following data passed to component DragAndDropList i.e. the array must be in form of key and value
const data = [
{ key: 1, value:"Mango" },
{ key: 2, value: "Orange" },
{ key: 3, value: "Apple" },
{ key: 4, value: "Banana" },
{ key: 5, value: "Cherry" },
{ key: 6, value: "Watermelon" },
{ key: 7, value: "Grapes" },
{ key: 8, value: "Pineapple" },
]
Name | Type | Description |
---|---|---|
data | [] | Required. an array that populates the list |
onDrop | (item)=>void | . a callback function that is called when user drops an item |
listItemStyle | style | style properties that need to be applied on every item of list |
containerWidth | number | width of the container that contains draggable list and drop area |
dropBoxStyle | style | style properties that need to be applied on the dropbox |
listItemContainerStyle | style | style properties that need to be applied on the container containing all the list items |
listItemContainerStyle | style | style properties that need to be applied on the container containing all the list items |
parentContainerStyle | style | style properties that need to be applied on the parent container containing both the list items and droppable area |
import { StatusBar } from "expo-status-bar";
import { SafeAreaView, StyleSheet, Text, View } from "react-native";
import DragAndDropList from "react-native-drag-and-drop-list";
const data = [
{ key: 1, value: "Mango" },
{ key: 2, value: "Orange" },
{ key: 3, value: "Apple" },
{ key: 4, value: "Banana" },
{ key: 5, value: "Cherry" },
{ key: 6, value: "Watermelon" },
{ key: 7, value: "Grapes" },
{ key: 8, value: "Pineapple" },
];
export default function App() {
return (
<SafeAreaView style={{ width: "100%", height: "100%" }}>
<View style={styles.container}>
<DragAndDropList
data={data}
onDrop={(item) => {
console.log(item);
}}
listItemStyle={{
backgroundColor: "black",
width: "80%",
}}
containerWidth={300}
listItemContainerStyle={{
backgroundColor:"skyblue",
width:"50%"
}}
parentContainerStyle={
{
marginStart:100,
marginTop:100
}
}
dropBoxTitle="Drop Here"
dropBoxStyle={{
width: "50%",
marginStart:100,
height: "30%",
backgroundColor: "orange",
}}
/>
<StatusBar style="auto" />
</View>
</SafeAreaView>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
},
});
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
},
});
FAQs
The Drag and Drop List with Drop Box is an intuitive and user-friendly interface that allows users to easily organize and manage items by dragging them from a list and dropping them into a designated drop box.
The npm package react-native-drag-and-drop-list receives a total of 2 weekly downloads. As such, react-native-drag-and-drop-list popularity was classified as not popular.
We found that react-native-drag-and-drop-list demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.