Skip to Content
✨ QuickCode UI keeps growing! More components, more features, and more ways to make your projects shine. Stay tuned & maybe… hire me or sponsor me 😉 
DocumentationDraggable Cards

Draggable Cards

An interactive card component that allows users to reorder items through drag and drop. Perfect for task management, prioritization interfaces, and customizable dashboards.

Install Dependencies

npx
quickcode-ui add DraggableCards

Default Usage

Default Vertical Cards

  • Project Alpha

    High-priority development task with tight deadline

  • Design Review

    UI/UX review session for the new dashboard

  • Code Review

    Review pull requests from the development team

  • Team Meeting

    Weekly sync with the entire development team

Horizontal Layout

Horizontal Draggable Cards

  • Project Alpha

    High-priority development task with tight deadline

  • Design Review

    UI/UX review session for the new dashboard

  • Code Review

    Review pull requests from the development team

  • Team Meeting

    Weekly sync with the entire development team

Bordered Variant

Bordered Variant

  • Marketing Campaign

    Launch the new product marketing campaign across all channels

  • Customer Support

    Respond to customer inquiries and resolve pending tickets

  • Data Analysis

    Analyze user behavior data from the past quarter

Large Size with Custom Handler

Large Size with Custom Handler

  • System Architecture

    Design and implement scalable system architecture for the new platform

  • Database Optimization

    Optimize database queries and improve overall performance metrics

Props

PropTypeDefaultDescription
cardsArray<{id: number, title: string, description: string}>[]Array of card objects to display and make draggable
horizontalbooleanfalseWhether to arrange cards horizontally instead of vertically
variant"default" | "bordered" | "filled""default"Visual style variant of the cards
size"sm" | "md" | "lg""md"Size variant affecting padding and text size
onReorder(newCards: Card[]) => voidundefinedCallback function called when cards are reordered
classNamestringundefinedCustom classes for the main container
cardClassNamestringundefinedCustom classes for individual cards
titleClassNamestringundefinedCustom classes for card titles
descriptionClassNamestringundefinedCustom classes for card descriptions
dragScalenumber1.02Scale factor applied to cards when being dragged
dragBoxShadowstringundefinedCustom box shadow for cards when being dragged
normalBoxShadowstringundefinedCustom box shadow for cards in normal state
dragBackgroundstringundefinedCustom background color/gradient for cards when dragging
normalBackgroundstringundefinedCustom background color/gradient for cards in normal state

Styling Examples

// Custom container styling <DraggableCards className="max-w-3xl bg-gray-50 dark:bg-gray-900 p-4 rounded-lg" /> // Custom card styling with proper dark mode <DraggableCards cardClassName="bg-gradient-to-r from-blue-500 to-purple-600 dark:from-blue-600 dark:to-purple-700 text-white border-none" titleClassName="text-yellow-300 dark:text-yellow-200" descriptionClassName="text-blue-100 dark:text-blue-200" />
Last updated on