Socket
Socket
Sign inDemoInstall

@blueprintui/crane

Package Overview
Dependencies
8
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @blueprintui/crane

Simple and lightweight drag and drop components and utilities.


Version published
Maintainers
1
Install size
2.82 MB
Created

Readme

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

Last updated on 02 Feb 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc