BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/wise-ui/reorderable-list

Reorderable List

wise-ui/reorderable-list
FreeComponent

A drag-and-drop sortable list with smooth animations.

Live preview

live · rendered by the registry
Rendered by wise-ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://wise-ui.com/r/reorderable-list.json

Source

registry/wise-ui/components/reorderable-list.tsxwise-ui.com/r/reorderable-list.json
1"use client"
2
3import * as React from "react"
4import {
5 DndContext,
6 closestCenter,
7 KeyboardSensor,
8 PointerSensor,
9 useSensor,
10 useSensors,
11 DragOverlay,
12 type DragStartEvent,
13 type DragEndEvent,
14} from "@dnd-kit/core"
15import {
16 arrayMove,
17 SortableContext,
18 sortableKeyboardCoordinates,
19 useSortable,
20 verticalListSortingStrategy,
21} from "@dnd-kit/sortable"
22import { CSS } from "@dnd-kit/utilities"
23import { motion } from "motion/react"
24import { cn } from "@/lib/utils"
25
26const EASE_OUT_QUART: [number, number, number, number] = [0.25, 1, 0.5, 1]
27
28interface ReorderableListProps<T extends { id: string | number }> {
29 items: T[]
30 onReorder: (items: T[]) => void
31 renderItem: (item: T, index: number) => React.ReactNode
32 className?: string
33 itemClassName?: string
34 gap?: number
35 dragTarget?: "card" | "handle"
36}
37
38interface SortableItemProps {
39 id: string | number
40 children: React.ReactNode
41 className?: string
42 isDragOverlay?: boolean
43 activeId: string | number | null
44 dragTarget: "card" | "handle"
45}
46
47function SortableItem({
48 id,
49 children,
50 className,
51 isDragOverlay,
52 activeId,
53 dragTarget,
54}: SortableItemProps) {
55 const {
56 attributes,
57 listeners,
58 setNodeRef,
59 transform,
60 transition,
61 isDragging,
62 } = useSortable({ id })
63
64 const style: React.CSSProperties = {
65 transform: CSS.Transform.toString(transform),
66 transition,
67 }
68
69 const overlayStyle: React.CSSProperties = isDragOverlay
70 ? {
71 boxShadow: "0 8px 32px rgba(0,0,0,0.18)",
72 transform: "scale(1.02)",
73 }
74 : {}
75
76 const dragProps = dragTarget === "card" ? { ...attributes, ...listeners } : {}
77
78 return (
79 <motion.div
80 ref={isDragOverlay ? undefined : setNodeRef}
81 style={{ ...style, ...overlayStyle }}
82 className={cn(
83 "touch-none",
84 dragTarget === "card" && "cursor-grab active:cursor-grabbing",
85 isDragOverlay && "cursor-grabbing",
86 isDragging && "opacity-40",
87 className
88 )}
89 layout={!isDragOverlay}
90 transition={{ duration: 0.3, ease: EASE_OUT_QUART }}
91 {...dragProps}
92 >
93 {dragTarget === "handle" ? (
94 <ReorderableListHandleContext.Provider
95 value={{ attributes, listeners }}
96 >
97 {children}
98 </ReorderableListHandleContext.Provider>
99 ) : (
100 children
101 )}
102 </motion.div>
103 )
104}
105
106// Context for drag handle
107// eslint-disable-next-line @typescript-eslint/no-explicit-any
108// … truncated

What it pulls in

npm packages

  • @dnd-kit/core
  • @dnd-kit/sortable
  • @dnd-kit/utilities
  • clsx
  • tailwind-merge

Files it writes

  • registry/wise-ui/components/reorderable-list.tsx

Facts

Registry
wise-ui
Type
registry:component
Access
Free
Files written
1
Licence
the repository states none
First indexed
2026-08-02
Last confirmed
yesterday

Go to the source

Docs on wise-ui wise-ui.com r-pathak/wise-ui on GitHub Raw registry item This item as JSON

More from wise-ui

All 20 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Animated Tabsanimated-tabswise-uiComponentsFree3 deps
Border Beamborder-beamwise-uiComponentsFree3 deps
Data Tabledata-tablewise-uiComponentsFree3 deps
Dockdockwise-uiComponentsFree3 deps
Dot Matrixdot-matrixwise-uiComponentsFree2 deps
Editable Texteditable-textwise-uiComponentsFree4 deps
Gradient Sidebargradient-sidebarwise-uiComponentsFree3 deps
Kanban Boardkanban-boardwise-uiComponentsFree6 deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex