@lynx-js/lynx-ui-draggable
v3.130.0
Published
A headless Draggable component for ReactLynx. It provides drag-and-drop primitives via main-thread execution.
Readme
@lynx-js/lynx-ui-draggable
A headless Draggable component for ReactLynx. It provides drag-and-drop primitives via main-thread execution.
Installation
We strongly recommend installing and using this component through the main @lynx-js/lynx-ui package:
# pnpm (recommended)
pnpm add @lynx-js/lynx-ui
# npm
npm install @lynx-js/lynx-ui
# yarn
yarn add @lynx-js/lynx-ui(If necessary, you can still install the standalone package via pnpm add @lynx-js/lynx-ui-draggable)
Usage
The lynx-ui-draggable follows a headless composition pattern.
Component Structure
The Draggable component is composed of several specialized sub-components to give you full control over the layout and styling.
<DraggableRoot>
<DraggableArea>
<Draggable />
</DraggableArea>
</DraggableRoot>DraggableRoot: The root container that manages the state and logic.DraggableArea: The defined area where items can be dragged.Draggable: The actual draggable item.useDraggable: A hook for custom draggable implementations.
About @lynx-js/lynx-ui
This component is part of @lynx-js/lynx-ui, a headless UI library officially maintained by the Lynx team, provided as a reference for building flexible, universal, and high-performance ReactLynx components.
License
lynx-ui is Apache License 2.0 licensed.
