New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@leveluptuts/drop-in

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leveluptuts/drop-in

# Drop In

latest
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

@leveluptuts/drop-in

Drop In

Jaws Aaron Homoki

NPM

Demo

https://levelup-drop-in.netlify.com/

Install

yarn add @leveluptuts/drop-in

Usage

The Syntax

import { DropIn, DragItem } from '@leveluptuts/drop-in';

function Component() {
  return (
    <DropIn data={data}>
      {activeColors.map(({ background, height }) => (
        <DragItem key={background}>
          <Square background={background} height={height} />
        </DragItem>
      ))}
    </DropIn>
  );
}

More options

import { DropIn, DragItem } from '@leveluptuts/drop-in';

function Component() {
  return (
    <DropIn data={data} whileHover={{ scale: 1.02 }} whileTap={{ scale: 1.04 }}>
      {activeColors.map(({ background, height }) => (
        <DragItem key={background}>
          <Square background={background} height={height} />
        </DragItem>
      ))}
    </DropIn>
  );
}

API

DropIn

The parent of an array of components

PropTypeDefaultDescription
childrenArrayOfComponentsAn array of React Components
dataArrayOfDataThe data that powers the children
onDropfunc(data) => dataOPTIONAL _ function that runs on drop, sends new data
whileTapFramer Property{ scale: 1.12 }OPTIONAL _ object that sets the animation state
whileHoverFramer Property{ scale: 1.03 }OPTIONAL _ object that sets the animation state

DragItem

The item to be moved

PropTypeDefaultDescription
keystringA unique key
childrenComponent or ElementThe thing inside the thing you're moving
elementdom element for drag item'div'A string of the dom element being dragged

FAQ

Contributing

yarn yarn start

(in another tab) to run example

cd example yarn yarn start

Prior Art and Inspirations

Lots of this code has been adopted from https://codesandbox.io/s/framer-motion-drag-to-reorder-r4qme

License

MIT © leveluptuts

FAQs

Package last updated on 07 Oct 2020

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