Socket
Socket
Sign inDemoInstall

@fw-components/fw-dnd

Package Overview
Dependencies
44
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @fw-components/fw-dnd

Drag-n-drop list


Version published
Weekly downloads
9
decreased by-10%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

Drag and drop list

The fw-dnd component is used to reorder the list of items using drag and drop.

Installation

npm i @fundwave/fw-dnd

Example usage

const dragList = [{ name:"Aayush", company:"Fundwave" }, { name:"Isha Sharma", company:"Fundwave" }]
<fw-dnd
  .list=${dragList}
  @list-updated=${updateList}
  .dragItemRenderer=${ (item) => html `<p>${item.name}</p>` }
></fw-dnd>

API

Properties/Attributes

NameTypeDefaultDescription
listArray[]Array which have all list items
dragItemRendererFunctionHTML content render for every item of list

Methods

dragStart()

Stores drag target element to categories property and set dataTransfer of event

drop()

Handle the reordering of the list Using startContainer and endContainer

Events

@list-updated

Return the reordered list to the parent

FAQs

Last updated on 26 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