Logo
Layout

Reorderable List

A drag and drop list that supports animated reordering

Overview

Reorderable List allows users to drag items to reorder them within a horizontal or vertical layout. It supports layout groups, spacing, alignment, animated repositioning, scaling and fading during drag, and event callbacks when the list order changes.

Preview

Usage

Add Reorderable List component to a parent RectTransform

Add child UI elements under it

Optionally add Horizontal Layout Group or Vertical Layout Group

Start dragging the objects!


Properties

Settings

NameTypeDescription
instantSnapboolIf true, items snap instantly instead of animating
itemSpacingfloatSpacing between items when no layout group exists
animationDurationfloatDuration for all movement animations
animationCurveAnimationCurveControls easing used in animations

Drag Settings

NameTypeDescription
dragAlphafloatAlpha applied to the dragged item
dragScalefloatScale multiplier for the dragged item

References

NameTypeDescription
listContainerRectTransformParent container of the items
canvasCanvasUsed for screen to local conversions

Events

EventDescription
onOrderChangedCalled when an item is dropped into a new position

Public Methods

NameParametersDescription
RefreshItemsList()NoneRebuilds the internal item list and initializes items
RefreshLayout()NoneForces items to snap or animate to proper positions

Code Example

ReorderableListExample.cs
using UnityEngine;
using Evo.UI;

public class ReorderableListExample : MonoBehaviour
{
    public ReorderableList reorderable;

    void Start()
    {
        // Enable smooth animation when rearranging
        reorderable.instantSnap = false;

        // Customize spacing (if no layout group)
        reorderable.itemSpacing = 12f;

        // Drag visuals
        reorderable.dragAlpha = 0.8f;
        reorderable.dragScale = 1.15f;

        // Animation settings
        reorderable.animationDuration = 0.25f;
        reorderable.animationCurve = AnimationCurve.EaseInOut(0, 0, 1, 1);

        // Listen to order changes
        reorderable.onOrderChanged.AddListener(OnListOrderChanged);

        // Ensure items are initialized
        reorderable.RefreshItemsList();
    }

    void OnListOrderChanged(ReorderableListItem item, int oldIndex, int newIndex)
    {
        Debug.Log("Item moved from " + oldIndex + " to " + newIndex);
    }
}

On this page