Skip to content

Sortable List

Free

A list that people put in their own order, by drag with a mouse, touch, or keys. A Move menu on each row does the same with no drag.

  • Base UI
  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 8, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Render the rows from the order that the list owns.

stage-order.tsx

SortableList

<ul>
PropTypeDefaultDescription
valuereadonly string[]—The item ids in order (controlled).
defaultValuereadonly string[]EMPTY_ORDERThe first order when the list owns it (uncontrolled).
onValueChange—Called once per finished move with the new order: at the drop of a drag (not on each step), and at once for a menu move. Not called for a cancel (Escape) or a drop in the same place.
orientation"grid""horizontal""vertical""vertical"vertical (default) and horizontal lock the drag to their axis; grid moves freely.
variant"card""plain""plain"plain (default): rows with no edge. card: separate rows with an edge.
size"default""lg""sm""default"The row height: sm 32px, default 40px, lg 48px.
disabledbooleanfalseNo item can be lifted or moved.
labels—The words of the list (the names, the menu, the key bar), merged over SORTABLE_LIST_LABELS.
children—The items. With an uncontrolled list, render them from the order: (order) => ….
driverRef—Drives a drag from code (DragDriver, an item id as the item): a staged scene, a tour, or a test lifts an item, carries it, and drops it through the same drag as a pointer, with the lift, the room the others make, and the drop flight.
...props<ul> attributes—Every other attribute goes to the <ul>, with a ref.

SortableListItem

<li>
PropTypeDefaultDescription
valueRequiredstring—The item id: one id of the list value.
labelstringidThe name on the handle and the Move menu. Default: the id.
disabledbooleanfalseThe item cannot be lifted. Other items still move past it.
lockedbooleanfalseThe item cannot be lifted and holds its place: no item moves past it (a pinned row). The handle shows a lock in place of the grip.
...props<li> attributes—Every other attribute goes to the <li>, with a ref.

SortableListHandle

<button>
PropTypeDefaultDescription
classNamestring—
busyboolean—The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading.
spinnerPlacement"center""start"—center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label.
glass"clear""dark""light"—
rounded"default""full"—
lockedIconReactNode—The mark of a locked item, in place of the grip. Default: a lock (pass a pin for a pinned row).
From Base UIButtonBase UI docs
focusableWhenDisabledbooleanfalseWhether the button should be focusable when disabled.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

SortableListItemMoveMenu

PropTypeDefaultDescription
childrenReactNode—The parts: a SortableListItemMoveMenuTrigger and a SortableListItemMoveMenuContent.
From Base UIMenu.RootBase UI docs
defaultOpenbooleanfalseWhether the menu is initially open. To render a controlled menu, use the open prop instead.
loopFocusbooleantrueWhether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys.
highlightItemOnHoverbooleantrueWhether moving the pointer over items should highlight them. Disabling this prop allows CSS :hover to be differentiated from the :focus (data-highlighted) state.

SortableListItemMoveMenuTrigger

<button>
PropTypeDefaultDescription
classNamestring—
busyboolean—The button waits for the app (busy words): a spinner, aria-busy, and no clicks. Focus stays on the button. The style hook stays data-loading.
spinnerPlacement"center""start"—center (default): the spinner covers the label. start: it takes the leading icon slot. The icon sizes always use center, because their one icon is the label.
glass"clear""dark""light"—
rounded"default""full"—
From Base UIButtonBase UI docs
focusableWhenDisabledbooleanfalseWhether the button should be focusable when disabled.
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<button> attributes—Every other attribute goes to the <button>, with a ref.

SortableListItemMoveMenuContent

<div>
PropTypeDefaultDescription
classNamestring—
arrowboolean—Show an arrow that points at the trigger. The gap grows from 4px to 8px.
backdropboolean—Put a clear layer under the popup (Base UI Menu.Backdrop), for example to dim it.
portalProps—Other Base UI props of the inner parts. A className here adds to the component classes.
positionerProps—
backdropPropsPopupPartProps<MenuBackdropProps>—
arrowPropsPopupPartProps<MenuArrowProps>—
childrenReactNode—More items after the moves (Rename, Remove), below a separator.
From Base UIMenu.PopupBase UI docs
anchor—An element to position the popup against. By default, the popup will be positioned against the trigger.
positionMethod"absolute""fixed"'absolute'Determines which CSS position property to use.
sideOffsetnumber | OffsetFunction0Distance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment. The function takes a data object parameter with the following properties: - data.anchor: the dimensions of the anchor element with properties width and height. - data.positioner: the dimensions of the positioner element with properties width and height. - data.side: which side of the anchor element the positioner is aligned against. - data.align: how the positioner is aligned relative to the specified side.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Use it when the order is the value.
  • Use SortableListItemMoveMenu for a way with no drag.
  • Use orientation="grid" for widgets.
  • To move items between columns, use a Kanban.
  • For a nested list, use a Tree.
SpaceLifts the focused item, and drops it.
EnterDrops the lifted item.
Up ArroworDown ArroworLeft ArroworRight ArrowMoves the lifted item.
EscCancels the move.

Every move is also in the Move menu, with no drag.

The key bar (DragKeyHint) shows the keys during a keyboard drag.

The label names the handle.

Others make room
panel · 260ms
Drop
sheet · 300ms

Built with

Installs with Sortable List

Components
Button,Menu
  1. AddedSortable List, with Button, Menu.
Open the release