Skip to content
↑↓ to navigate↵ to openesc to close

Menu

Sortable List

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. Space lifts a row and drops it again, and Escape cancels the lift.

  • 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 your package manager, or copy the source manually.

Run it in a project set up with shadcn-vue. The source is copied to components/beui and its dependencies are added to your package.json. Read the shadcn-vue guide

bunx --bun shadcn-vue@latest add @beui-vue/sortable-stack

Import the shared styles once in your application.

TSUsage
import SortableStack from '@/components/beui/layout/SortableStack.vue'
import '@/components/beui/styles.css'

API Reference

SortableList

v-model:items?
Row[]

Rows in their current order, `v-model:items`.

Default—
defaultItems?
Row[]

Starting rows when `v-model:items` is not bound.

Default[]
#renderItem?
slot

Row contents for the convenience composition when the default slot is omitted.

Default—
getItemLabel
(item: Row) => string

Screen-reader label of a row; the visible row is up to the slot.

Default—
#default?
slot

Compose the parts; receives the items in their current order. Omit it to use `renderItem`.

Default—
label?
string

Accessible name of the list.

Default—
disabled?
boolean
Defaultfalse
showUndo?
boolean

Show the automatic undo button in the convenience composition.

Defaulttrue
class?
string
Default—
itemClassName?
string

Extra classes for every row.

Default—
labels?
Partial<SortableListMessages>

Override any built-in string.

Default—

SortableListGroup

class?
string
Default—
#default?
slot
Default—

SortableListItem

id
string

Identity of an item supplied to the root. Use it as the `v-for` key too.

Default—
class?
string
Default—
#default?
slot
Default—

SortableListHandle

class?
string
Default—
disabled?
boolean
Default—
#default?
slot

Replaces the grip icon.

Default—

SortableListItemContent

class?
string
Default—
#default?
slot
Default—

SortableListUndo

class?
string
Default—
disabled?
boolean
Default—
#default?
slot

Replaces the icon and label.

Default—

Updated