Reorder

Reorder is a component that allows you to change the order of items using drag and drop.

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇
  • 五条悟
  • 七海建人

Usage

import { Reorder } from "@yamada-ui/react"
<Reorder.Root>
  <Reorder.Item value="虎杖悠仁">虎杖悠仁</Reorder.Item>
  <Reorder.Item value="伏黒恵">伏黒恵</Reorder.Item>
  <Reorder.Item value="釘崎野薔薇">釘崎野薔薇</Reorder.Item>
</Reorder.Root>

Use items

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇
  • 五条悟
  • 七海建人

Change Variant

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇

Change Size

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇

Change Orientation

To change the orientation, set orientation to "vertical" or "horizontal". By default, "vertical" is set.

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇
  • 五条悟

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇
  • 五条悟

Limit the Draggable Area

To limit the draggable area, use ReorderTrigger.

  • 虎杖悠仁

  • 伏黒恵

  • 釘崎野薔薇

Handle Completion Events

If you want to handle the event when the user's drag and drop has finished and the order of items is completed, use onCompleteChange. onCompleteChange provides the completed order as an array.

Completed order: 虎杖悠仁, 伏黒恵, 釘崎野薔薇, 五条悟

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇
  • 五条悟

Use in Scrollable Area

When using in an area with scroll, set layoutScroll to true to ensure items can measure their offsets correctly.

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇
  • 五条悟
  • 七海建人

Control

Current order: 虎杖悠仁, 伏黒恵, 釘崎野薔薇, 五条悟

  • 虎杖悠仁
  • 伏黒恵
  • 釘崎野薔薇
  • 五条悟

Props