Sortable list of items with drag-and-drop
For AI Agents
Hand your agent this brief or the ReUI MCP, not a screenshot. Free to install.
Best for: Product files such as images, specs, video and audio, each row with a type icon, a colored badge and its size
When to use
- Ranked lists such as a play queue, notification channels or release tasks, put in order by a grip
- Tile grids such as a media library, where cards change places across rows and columns
- Grouped options and menus reordered in place, such as product variants or sidebar menu entries
When not to use
- A reorder that must reach a server and roll back when the save fails: use the Sortable Persisted Order example
- A titled music queue with a track count and a now playing mark: use the Sortable Playlist example
- Cards that move between several status columns on one board: use the Kanban component
- Ranked table rows that keep several columns of values lined up: use the Drag & Drop blocks
- A whole page layout of sidebar, top bar and content area around the list: use the App Shell blocks
Agent notes
handleValueChangeonly stores the order and raises atoastper drop; send the new order to your API there- Each row carries a pointer cursor and an empty
onClickstub; open the file from it or drop both - Drag listeners sit on
SortableItemHandleonly, so aSortableItemrendered without one cannot be dragged - Passing
onMoveskips the built-in reorder, so neitheronValueChangenoronValueCommitfires on drop - The drag preview clones the child of
Sortablewhosevaluematches the dragged item, so a wrapper aroundSortableItemneeds thatvaluetoo
Third-party API docs
- Sonner v2: API reference, docs
https://reui.io/components/sortable/c-sortable-1.mdget_example("c-sortable-1")npx shadcn@latest add @reui/c-sortable-1About Shadcn Sortable File List
Sortable list of items with drag-and-drop. Built by composing Badge, Sortable. Uses sonner alongside the shadcn primitives. A free, open source shadcn sortable example you can install with npx shadcn@latest add @reui/c-sortable-1 and edit as your own code.
What You Can Build With Shadcn Sortable File List
- Composes Badge, Sortable, so it drops into any project already using those components.
- Install it with the shadcn CLI: npx shadcn@latest add @reui/c-sortable-1
- Open source and free, with the full source on this page to copy or adapt.
More Shadcn Sortable Examples
- Grid Layout Sortable list of items with grid layout
- Nested Layout Sortable list of items with nested layout
- Playlist Sortable playlist with frame
- Settings Priority Sortable settings priority with frame
- Sidebar Navigation Sortable sidebar navigation with frame
- Image Gallery Sortable image gallery grid with frame
- Persisted Order Sortable list persisted to a backend
Related Shadcn Component Categories
Open-source shadcn spinner components for loading indicators, async actions, and button states.
Open-source shadcn stepper components for multi-step forms, checkout flows, and onboarding.
Open-source shadcn switch components for settings toggles, preferences, and binary choices.
Open-source shadcn table components for admin tables, data display, and responsive lists.
Open-source shadcn tabs components for segmented content, settings views, and dashboard sections.
Open-source shadcn textarea components for comments, long-form input, and support tickets.
Frequently Asked Questions
When should I use Shadcn Sortable File List?
Use it for product files such as images, specs, video and audio, each row with a type icon, a colored badge and its size.
Shadcn Sortable as a whole fits:
- Ranked lists such as a play queue, notification channels or release tasks, put in order by a grip
- Tile grids such as a media library, where cards change places across rows and columns
- Grouped options and menus reordered in place, such as product variants or sidebar menu entries
For a reorder that must reach a server and roll back when the save fails, use the Sortable Persisted Order example. For a titled music queue with a track count and a now playing mark, use the Sortable Playlist example. For cards that move between several status columns on one board, use the Kanban component. For ranked table rows that keep several columns of values lined up, use the Drag & Drop blocks. For a whole page layout of sidebar, top bar and content area around the list, use the App Shell blocks.
How do I install Shadcn Sortable File List?
Is Shadcn Sortable File List free to use?
Which components does Shadcn Sortable File List use?
Start building with ReUI Pro today.
Every Pro block, every style, and every future addition, with one license for unlimited projects.
From $249, once. Lifetime updates.