Socket
Book a DemoInstallSign in
Socket

draggable-list-items

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

draggable-list-items

A reusable drag-and-drop list component built with React, Next.js, Tailwind CSS, and dnd Kit.

1.0.2
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Drag-and-Drop List Component

Overview

Drag-and-Drop List is a reusable React component for creating interactive and customizable draggable lists. Built with Tailwind CSS and the powerful dnd-kit library, this component provides a smooth drag-and-drop experience for rearranging list items.

Features

  • Intuitive Drag-and-Drop: Rearrange items seamlessly with a fluid and responsive user interface.
  • Customizable Design: Easily adapt the styles using Tailwind CSS or your own CSS.
  • Lightweight and Fast: Built with modern technologies for optimal performance.

Demo

  • Check out the demo here: https://draggable-list-items.vercel.app/

Installation

Install the library via npm:

npm install draggable-list-items

Usage

Here’s an example of how to use the Drag-and-Drop List in your project:

JavaScript Example

import DraggableList from 'draggable-list-items';

const items = [
  { id: 1, title: 'Item 1', description: 'Description 1', image: 'https://via.placeholder.com/150' },
  { id: 2, title: 'Item 2', description: 'Description 2', image: 'https://via.placeholder.com/150' },
  { id: 3, title: 'Item 3', description: 'Description 3', image: 'https://via.placeholder.com/150' },
];

function App() {
  return <DraggableList items={items} />;
}

export default App;

TypeScript Example

import DraggableList from 'draggable-list-items';

type Item = {
  id: number;
  title: string;
  description: string;
  image: string;
};

const items: Item[] = [
  { id: 1, title: 'Item 1', description: 'Description 1', image: 'https://via.placeholder.com/150' },
  { id: 2, title: 'Item 2', description: 'Description 2', image: 'https://via.placeholder.com/150' },
  { id: 3, title: 'Item 3', description: 'Description 3', image: 'https://via.placeholder.com/150' },
];

function App() {
  return <DraggableList items={items} />;
}

export default App;

Styling

The component is styled using Tailwind CSS. Ensure you have Tailwind set up in your project, or use the bundled styles provided with the library:

import 'draggable-list-items/dist/styles.css';

How It Works

The Drag-and-Drop List uses the following technologies:

  • React: A declarative JavaScript library for building user interfaces.
  • dnd-kit: A lightweight and flexible drag-and-drop library for React.
  • Tailwind CSS: A utility-first CSS framework for rapidly building custom designs.

Contributing

We welcome contributions to improve the Drag-and-Drop List component. If you’d like to contribute:

  • Fork the repository.
  • Create a new branch (git checkout -b feature/new-feature).
  • Make your changes and test thoroughly.
  • Submit a pull request.

Changelog

Check out the Releases for details on new features, bug fixes, and updates.

Contributions

If you encounter any issues or have questions, feel free to open an issue.

FAQs

Package last updated on 04 Dec 2024

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.