1.0.7 • Published 10 months ago

react-drag-cards v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

React Drag Cards

Version License

Sneak peek

demo1

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

PropTypeDescription
cardsArrayAn array of card objects. Each card should have an id and content field.
onDropFunctionCallback 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
1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago