npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

draggable-list-items

v1.0.2

Published

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

Downloads

202

Readme

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

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:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/new-feature).
  3. Make your changes and test thoroughly.
  4. 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.