Preet Suthar

Draggable List

Cards 46

About

A reorderable list component with drag and drop functionality.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Draggable List to your project and fits it to your theme.

Code

How Draggable List is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { DraggableList,DraggableItem } from "@/components/ui/draggable-list"
import { useState } from "react";

const Demo = () => {
  const [items, setItems] = useState([
    { id: "1", content: <DraggableItem>First Item</DraggableItem> },
    { id: "2", content: <DraggableItem>Second Item</DraggableItem> },
    { id: "3", content: <DraggableItem>Third Item</DraggableItem> },
  ]);
 
  const handleReorder = (newItems: DraggableItemProps[]) => {
    setItems(newItems);
    // Do something with the new order
  };
 
  return (
    <DraggableList
      items={items}
      onChange={handleReorder}
      className="max-w-sm w-full"
    />
  );
}

export {Demo}

Dependencies

More by Preet Suthar

View all
  • Modern & Stunning sign in

    Modern & Stunning sign in

    1.6K
  • Shining Text

    Shining Text

    1.5K
  • Magic Text

    Magic Text

    845
  • Toolbar

    Toolbar

    822
  • Hero 2

    Hero 2

    818
  • Typewriter Text

    Typewriter Text

    769
  • AI Chat Input

    AI Chat Input

    734
  • Full Screen Signup

    Full Screen Signup

    731

More in Cards

View all
  • Stats cards with links

    Stats cards with links

    33
  • Course Design Cards

    Course Design Cards

    1.1K
  • Card

    Card

    70
  • Statistics Card 2

    Statistics Card 2

    264
  • Statistics Card 10

    Statistics Card 10

    263
  • Card

    Card

    17
  • Card Studio

    Card Studio

    9
  • The Item one

    The Item one

    3