Component

ReorderBack

It moves two pieces of content into each other’s slots on click, then requires another click to restore the original order.

01 / Preview

Try it yourself.

Preview Interactive
First
Second

Click once to swap the slots. Click again to undo the swap.

Mechanism
1
Click the two-item arrangement.
2
Watch both pieces trade places.
3
Click again to undo your work.

02 / Usage

Put it somewhere.

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

export function Example() {
  return <ReorderBack first="First" second="Second" />;
}

03 / API

Small surface area.

PropTypeDescription
firstReactNodeThe content in the first slot.
secondReactNodeThe content in the second slot.