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

sleek-drag-and-drop

v1.0.5

Published

Easily implement interactive drag and drop functionality in your React applications with Sleek Drag and Drop. This comprehensive package leverages Tailwind CSS for styling, allowing you to create highly customizable and visually appealing drag and drop ex

Downloads

13

Readme

sleek-drag-and-drop

Easily implement interactive drag and drop functionality in your React applications with Sleek Drag and Drop. This comprehensive package leverages Tailwind CSS for styling, allowing you to create highly customizable and visually appealing drag and drop experiences.

Documentation

Key Features:

Customizable Components:

Tailor the drag and drop elements to fit your application's design and requirements.

Dynamic Item Rendering:

Effortlessly render items dynamically using your preferred component functions.

Drag Context:

Utilize a powerful DragContext component to manage drag states and behaviors across your application.

Seamless Integration:

Integrate with existing projects with minimal configuration and code changes.

Flexible and Extendable:

Built to be flexible and easily extendable to accommodate complex drag and drop scenarios.

Installation

Create a react project

npx create-react-app my-app
cd my-app

Install the package with npm or yarn

npm i sleek-drag-and-drop
yarn add sleek-drag-and-drop

For styling install tailwindcss

npm i -D tailwindcss
npx tailwindcss init

Usage/Examples

1. import

import { DragDropContextProvider } from 'sleek-drag-and-drop'

2. import [ DragContext ] and [ DropContext ]

import { DragContext, DropContext } from 'sleek-drag-and-drop'

3. Wrap the and inside

import { DragDropContextProvider, DragContext, DropContext } from 'sleek-drag-and-drop'

export function app(){

    const vegetables = [
        {id:1, name:"potato"},
        {id:2, name:"tomato"},
        {id:3, name:"capsicum"}
    ]

    return (
        <DragDropContextProvider>
            <div>
                <DragContext content={vegetables} />
            <div/>
            <div>
                <DropContext />
            <div/>
        </DragDropContextProvider>
    )
}

Props

1. content:[array]

The array of items you want to render in the draglist.

// array of objects containing id and name

    const vegetables = 
    [
        {id:1, name:"potato"},
        {id:2, name:"tomato"},
        {id:3, name:"capsicum"}
    ]
// pass the array like this

    <DragContext content={vegetables} />

2. className:[string]

You can pass className for styling the draggable list items.

<DragContext className="bg-blue-700 rounded-xl">
<DropContext className="bg-red-300 w-[5rem] rounded-xl">

3. deleteKey:[boolean]

if you want a delete button in the droplist items you can pass deleteKey

<DropContext deleteKey={true} >

Tech Stack

Client: React, ContextAPI, TailwindCSS

Acknowledgements

Open-Source Contributions

To contribute to this package check out the github repository:

Query

For any queries, please contact on linkedIn:

Authors

🚀 About Me

Prince Chaurasia

Hi,

I'm Prince Chaurasia, a passionate software developer specializing in React Native and web development.Currently in my 4th semester of a B.Tech program, I am dedicated to expanding my skills and knowledge in the tech industry.

I am actively working on several projects, including a React Native application named 'chillx' and a versatile npm package called 'sleek-drag-and-drop' for implementing interactive drag and drop functionality in React applications. My projects reflect my commitment to creating efficient, user-friendly solutions with a strong emphasis on clean code and best practices.

I enjoy tackling challenging problems and am always eager to learn new technologies and methodologies. When I'm not coding, you can find me preparing for my exams, exploring the latest tech trends, or contributing to open-source projects.