1.0.7 ⢠Published 10 months ago
react-drag-cards v1.0.7
React Drag Cards
Sneak peek
Demo Link š
Table of Contents
Description
React Drag Cards is a simple and customizable drag-and-drop card component for React applications. It allows users to interactively rearrange cards within a container, making it ideal for use cases like Kanban boards, task lists, or any scenario requiring card manipulation.
Features
- Drag and drop functionality
- Easy to customize
- Lightweight and efficient
- Responsive design
- Supports React and Tailwind css
Installation
You can install the package via npm:
npm install react-drag-cards
Usage
Here's a quick example of how to use the React Drag Cards component in your application:
import React from 'react';
import DragCards from './DragCards';
const App = () => {
const cards = [
{
src: "https://assets.playgroundai.com/346dd2b5-47b7-4c0d-b0b4-bbf3e6cd249c.jpg",
alt: "Example image 1",
rotate: "6deg",
top: "20%",
left: "25%",
className: "w-36 md:w-56"
},
{
src: "https://images.playground.com/761f186aa1be4904ad6f5b18586377aa.jpeg",
alt: "Example image 3",
rotate: "-6deg",
top: "20%",
left: "40%",
className: "w-32 md:w-60"
},
// Add More Images
];
return (
<DragCards
title="SPACE"
titleColor="text-blue-800"
accentColor="text-red-500"
backgroundColor="bg-black"
cards={cards}
/>
);
};
export default App;
API Reference
Props
Prop | Type | Description |
---|---|---|
cards | Array | An array of card objects. Each card should have an id and content field. |
onDrop | Function | Callback function fired when cards are dropped. |
Contributing
We welcome contributions! Please read the CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
Acknowledgements
- Inspired by various drag-and-drop libraries.
react-drag-cards
āā .git
ā āā COMMIT_EDITMSG
ā āā config
ā āā description
ā āā fsmonitor--daemon
ā ā āā cookies
ā āā HEAD
ā āā hooks
ā ā āā applypatch-msg.sample
ā ā āā commit-msg.sample
ā ā āā fsmonitor-watchman.sample
ā ā āā post-update.sample
ā ā āā pre-applypatch.sample
ā ā āā pre-commit.sample
ā ā āā pre-merge-commit.sample
ā ā āā pre-push.sample
ā ā āā pre-rebase.sample
ā ā āā pre-receive.sample
ā ā āā prepare-commit-msg.sample
ā ā āā push-to-checkout.sample
ā ā āā sendemail-validate.sample
ā ā āā update.sample
ā āā index
ā āā info
ā ā āā exclude
ā āā objects
ā ā āā 11
ā ā ā āā 371e9addd6815085eabadb7077405f3c7e546d
ā ā āā 23
ā ā ā āā 8d2e4e6436b353404369d9a59fda5f1f980657
ā ā āā 2a
ā ā ā āā 76491572a66a83110c0c5f615aa8958e02fd3e
ā ā āā 2e
ā ā ā āā 7af2b7f1a6f391da1631d93968a9d487ba977d
ā ā āā 2f
ā ā ā āā c84199e034dd22b7cfd286ddb334ce33abe300
ā ā āā 63
ā ā ā āā 8ecbe17d8fae92693290ef80bcf7702160bbc6
ā ā āā 7a
ā ā ā āā 470ce5c61fb00fc180c7b155b6bb79f9baddf9
ā ā āā 7f
ā ā ā āā ffacebe185072853bb5e113f79a6c7ce652f84
ā ā āā 85
ā ā ā āā d97aa237cfc8dae365e7d87827062d9cd0eab0
ā ā āā 89
ā ā ā āā a305e028000a86c03e85344e31eb59d56354a0
ā ā ā āā f91e54dc6f03e3953a071b1e217e6ed9dd4f0a
ā ā āā 98
ā ā ā āā 1242b0c8e665ee747537b23d7986e2278df969
ā ā āā a3
ā ā ā āā b7af3c7c3284a948bdb3f039479a23f6ac0fe3
ā ā āā a5
ā ā ā āā 47bf36d8d11a4f89c59c144f24795749086dd1
ā ā ā āā 66af7229dd3cf2c65633200be063054337b9f4
ā ā āā bd
ā ā ā āā 6213e1dfe6b0a79ce7d8b37d0d2dc70f0250bb
ā ā āā df
ā ā ā āā 09b04204ced0f202c42ecdfaf143f026654756
ā ā āā ef
ā ā ā āā 5961e8eff2af2048955b5a24727960bf51c5fd
ā ā āā info
ā ā āā pack
ā āā refs
ā āā heads
ā ā āā main
ā āā remotes
ā ā āā origin
ā ā āā main
ā āā tags
āā .gitignore
āā babel.config.js
āā eslint.config.js
āā index.html
āā package-lock.json
āā package.json
āā postcss.config.js
āā README.md
āā src
ā āā App.jsx
ā āā DragCards.jsx
ā āā index.css
āā tailwind.config.js
āā vite.config.js
āā webpack.config.js