# Drag Reorder List

> Drag-to-reorder list with lift, tilt, shadow, and an empty-space cutout showing where the item will land.

<demo-drag-reorder-list>



</demo-drag-reorder-list>

## Installation

```bash
npx shadcn-vue@latest add "https://nxui.geoql.in/r/drag-reorder-list.json"
```

## Usage

```vue
<script setup lang="ts">
  import { ref } from 'vue';
  import DragReorderList from '~/components/ui/drag-reorder-list/DragReorderList.vue';

  const items = ref(['One', 'Two', 'Three']);
</script>

<template>
  <DragReorderList v-model="items" :item-height="56" :gap="8" />
</template>
```

Each row renders the item string by default. Use the default slot for custom row content:

```vue
<DragReorderList v-model="items">
  <template #default="{ item, index }">
    <span class="text-sm">{{ index + 1 }}. {{ item }}</span>
  </template>
</DragReorderList>
```

## Props

<table>
<thead>
  <tr>
    <th>
      Prop
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Default
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        model-value
      </code>
    </td>
    
    <td>
      <code>
        string[]
      </code>
    </td>
    
    <td>
      —
    </td>
    
    <td>
      Items to render (v-model). Emits the reordered array
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        item-height
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        56
      </code>
    </td>
    
    <td>
      Fixed row height in px
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        gap
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        8
      </code>
    </td>
    
    <td>
      Vertical gap between rows in px
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        show-handle
      </code>
    </td>
    
    <td>
      <code>
        boolean
      </code>
    </td>
    
    <td>
      <code>
        true
      </code>
    </td>
    
    <td>
      Show the grip handle. When <code>
        false
      </code>
      
       whole row drags
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        lift-scale
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        1.04
      </code>
    </td>
    
    <td>
      Scale applied to the lifted row
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        max-tilt
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        3
      </code>
    </td>
    
    <td>
      Max rotation (deg) from drag velocity
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        stiffness
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        500
      </code>
    </td>
    
    <td>
      Spring stiffness for settle/shift animations
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        damping
      </code>
    </td>
    
    <td>
      <code>
        number
      </code>
    </td>
    
    <td>
      <code>
        38
      </code>
    </td>
    
    <td>
      Spring damping for settle/shift animations
    </td>
  </tr>
</tbody>
</table>
