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

@joshcaplin/wasp

v0.8.0

Published

Wicked Awesome Sortable Panel - React component for drag & drop functionality

Downloads

21

Readme

Wasp

GitHub package.json version (branch) NPM npm bundle size (scoped) GitHub top language

Wasp is a simple wrapper around the react-beautiful-dnd library to provide drag & drop capabilities for a vertical list. This component allows you to reuse the same functionality across multiple apps without needing to duplicate logic, styling, etc. Follow the directions below and you'll have drag & drop functionality set up in less than 5 minutes!

:hammer: Installation

Wasp is available through the npm registry. It can be installed using the npm or yarn command line tool.

# Yarn 
yarn add @joshcaplin/wasp
# NPM 
npm install --save @joshcaplin/wasp 

:sunglasses: Usage

  • There is one required parameter:
    • itemsToList - input array of strings or objects to display in the list. The objects should have properties of title and description.
  • There is currently one optional parameter, with more coming soon:
    • onReorder() - called every time you reorder the list - passes the new array back to the parent component. If you don't care about the reordered array, you don't need to define a handler for this callback.
  • Live demo >>> codesandbox.io
import { Wasp } from '@joshcaplin/wasp';
  ...
  ...
//items can be hardcoded, pulled from a config file, returned from an API call, etc
const teams = [
  'Purdue Boilermakers', 
  'Arizona State Sun Devils', 
  'Scottsdale Fighting Artichokes',
];
<Wasp
  itemsToList={teams}
  //onReorder={handleReorderedItems}  //<-- enable if you need the updated array
/>

:raising_hand_man: Frequently asked questions

  • Should I use this library or react-beautiful-dnd?
    • Unless this library has the exact functionality & styling that you're looking for, you should probably use react-beautiful-dnd in your app since it has additional capabilities. You'll need to do the setup yourself, but you can use the source code here as a guide.
  • Why did you create this library?
    • Mostly as a proof-of-concept to understand the process of publishing an npm package and to learn how to build reusable React component libraries.
  • Why the heck is the library named Wasp?
    • It stands for Wicked Awesome Sortable Panel.
  • I don't like the default styling
    • Please rephrase in the form of a question. :stuck_out_tongue_winking_eye:

🧱 Built with

  • react-beautiful-dnd
    • built by Atlassian, rbd provides many options & flexibility for drag & drop functionality.
  • nwb
    • nwb is a toolkit to build reusable React component libraries rather than full-blown React apps.

:heart: Show your support

  • If this library was helpful to you, please ⭐️ this repo!

:writing_hand: Author

Josh Caplin - @joshcaplin

forthebadge