Skip to Content

drag-handle

ui

Grip indicator for drag-and-drop reordering.

Source Code

View the full component source code below.

import * as React from "react"
import { GripVertical } from "lucide-react"

import { cn } from "@/lib/utils"

function DragHandle({
  className,
  ...props
}: React.ComponentProps<"div">) {
  return (
    <div
      data-slot="drag-handle"
      aria-hidden="true"
      className={cn(
        "flex cursor-grab items-center justify-center text-muted-foreground hover:text-foreground active:cursor-grabbing transition-colors",
        className
      )}
      {...props}
    >
      <GripVertical className="size-4" />
    </div>
  )
}

export { DragHandle }

Installation

npx shadcn@latest add https://registry.mukoko.com/api/v1/ui/drag-handle

API

Fetch this component's metadata and source code from the registry API.

GET/api/v1/ui/drag-handle

Source

components/ui/drag-handle.tsx