Sortable List

Preview

Install

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

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

API Reference

SortableList

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

Convenience row contents when children are omitted.

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

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

Default—
label?
string
Default—
disabled?
boolean
Defaultfalse
showUndo?
boolean

Show the automatic undo button in the convenience composition.

Defaulttrue
className?
string
Default—
itemClassName?
string
Default—
labels?
Partial<{ label: string; instructions: string; moved: string; restored: string; reorder: string; undo: string; }>

Override any built-in string.

Default—

SortableListGroup

className?
string
Default—

SortableListItem

id
string

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

Default—
className?
string
Default—

SortableListHandle

className?
string
Default—

SortableListItemContent

className?
string
Default—

SortableListUndo

className?
string
Default—

Updated