Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@blueprintui/crane

Package Overview
Dependencies
Maintainers
0
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blueprintui/crane

Simple and lightweight drag and drop components and utilities.

  • 2.1.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@blueprintui/crane (beta)

Simple and lightweight drag and drop Web Components and utilities.

npm version

Install

NPM

npm install @blueprintui/crane

CDN

import 'https://cdn.jsdelivr.net/npm/@blueprintui/crane@0.0.0/include/crane.js/+esm';

Usage

<bp-crane>
  <button>1</button>
  <button>2</button>
  <button>3</button>
  <button>4</button>
  <bp-dropzone></bp-dropzone>
</bp-crane>
import '@blueprintui/crane/include/crane.js';

document.querySelector('bp-crane').addEventListener('bp-crane-drop', e => {
  e.detail.target.parentElement.insertBefore(e.detail.source, e.detail.target);
});

Components

  • bp-crane
  • bp-dropzone

Events

EventDescriptionDetail Return Type
bp-crane-startuser starts dragging an itemBpDraggableChangeEvent
bp-crane-enteritem enters valid drop targetBpDraggableChangeEvent
bp-crane-leaveitem leaves valid drop targetBpDraggableChangeEvent
bp-crane-enddrag operation endsBpDraggableChangeEvent
bp-crane-dropitem is dropped on a valid drop targetBpDraggableChangeEvent
bp-crane-overitem is dragged over a valid drop targetBpDraggableChangeEvent
bp-crane-dragitem is draggedBpDraggableChangeEvent

Event Detail

interface BpDraggableChangeEvent {
  source?: HTMLElement;
  target?: HTMLElement;
  type: 'start' | 'drag' | 'over' | 'drop' | 'enter' | 'leave' | 'end';
  interaction?: 'pointer' | 'key';
}

Keywords

FAQs

Package last updated on 19 Nov 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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc