Sortable List

Composable sortable list with group, item, drag handle, content and undo parts, plus a shared state hook. Spring layout, keyboard reordering, accessible position announcements, and controlled or uncontrolled items.

Preview

In the studio

Make room for what matters.

04 tasks

Drag a handle to reorder. With a handle focused, use Up and Down to move, Home and End to move to the edges.

  • Collect references

    Find the right direction

    01
  • Explore the visual system

    Type, color, and composition

    02
  • Build the first prototype

    Make the interaction tangible

    03
  • Ship something useful

    Polish the details and release

    04

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/sortable-stack

API Reference

SortableList

items?
T[]
—
defaultItems?
T[]
[]
onItemsChange?
((items: T[]) => void)
—
renderItem?
((item: T, index: number) => ReactNode)

Convenience row contents when children are omitted.

—
getItemLabel
(item: T) => string
—
children?
ReactNode | ((items: T[]) => ReactNode)

Compose parts; the render function receives items in their current order.

—
label?
string
Sortable items
disabled?
boolean
false
showUndo?
boolean

Show the automatic undo button in the convenience composition.

true
className?
string
—
itemClassName?
string
—

SortableListGroup

className?
string
—

SortableListItem

id
string

Identity of an item supplied to the root. Use it as the React key too.

—
className?
string
—

SortableListHandle

className?
string
—

SortableListItemContent

className?
string
—

SortableListUndo

className?
string
—

Updated