Component

DragDuplicate

It duplicates the content while being dragged, then folds both copies together when the drag ends.

01 / Preview

Try it yourself.

Preview Interactive
One copy is enough

Drag it anywhere. It makes a copy, then merges back when released.

Mechanism
1
Drag the content away from its starting point.
2
Watch a second copy travel alongside it.
3
Release it and both copies merge again.

02 / Usage

Put it somewhere.

example.tsxTSX
import { DragDuplicate } from "gra-ui";
import "gra-ui/styles.css";

export function Example() {
  return <DragDuplicate>One copy is enough</DragDuplicate>;
}

03 / API

Small surface area.

PropTypeDescription
childrenReactNodeThe content duplicated during a drag.