Migrating from ghl-ui DraggableElement to HighRise DraggableElement
This guide will help you migrate from the ghl-ui DraggableElement component to the new HighRise DraggableElement component.
Component Implementation Changes
Import Changes
diff
- import { UIDraggableElement } from '@gohighlevel/ghl-ui'
+ import { HLDraggableElement } from '@platform-ui/highrise'Basic Usage Changes
diff
- <UIDraggableElement
- :icon="Mail04Icon"
- :label="'mail'"
- />
-
+ <HLDraggableElement id="draggable-default">
+ <template #content>
+ <div>Visual structure for draggable content</div>
+ </template>
+ </HLDraggableElement>HighRise DraggableElement is a visual container only. It does not emit drag events and does not forward arbitrary DOM attributes. Wrap it with your drag-and-drop implementation (e.g.,
draggable+ native events or a library hook) and toggle styling with the props below.
Props Changes
| ghl-ui Prop | HighRise Prop | Notes |
|---|---|---|
icon | slot icon | Provide a custom drag handle icon via the icon slot |
label | slot content | Main content now belongs in the content slot |
| - | handlerPosition | 'left' (default) | 'right' | 'top' | 'bottom' |
| - | showHandler | Toggle the built-in handle (default: true) |
| - | bordered | Show border and shadow (default: true) |
| - | isDragging | Apply dragging styles (set from your DnD state) |
| - | isDroppable | Apply droppable styles (set from your DnD state) |
| - | disabled | Apply disabled styling |
| - | id | Optional identifier for analytics/testing |
Examples
Basic Draggable Shell
vue
<template>
<HLDraggableElement id="basic-draggable">
<template #content>
<div class="font-medium">Draggable item</div>
</template>
</HLDraggableElement>
</template>With Custom Icon and Right Handle
vue
<template>
<HLDraggableElement id="custom-handle" handler-position="right">
<template #icon>
<GripHorizontalIcon />
</template>
<template #content>
<div class="flex items-center gap-2">
<span class="text-sm text-gray-700">Drag me</span>
</div>
</template>
</HLDraggableElement>
</template>
<script setup>
import { GripHorizontalIcon } from '@gohighlevel/ghl-icons/24/outline'
</script>Integrating with Native Drag Events
vue
<template>
<div draggable @dragstart="handleDragStart" @dragend="handleDragEnd" @dragover.prevent="handleDragOver" @drop.prevent="handleDrop">
<HLDraggableElement id="stateful-drag" :is-dragging="isDragging" :is-droppable="isDroppable" :show-handler="true">
<template #content>
<div class="flex items-center gap-2">
<span>{{ item.name }}</span>
</div>
</template>
</HLDraggableElement>
</div>
</template>
<script setup>
import { ref } from 'vue'
import { HLDraggableElement } from '@platform-ui/highrise'
const item = { id: 1, name: 'Drag target' }
const isDragging = ref(false)
const isDroppable = ref(false)
const handleDragStart = () => {
isDragging.value = true
}
const handleDragEnd = () => {
isDragging.value = false
isDroppable.value = false
}
const handleDragOver = () => {
isDroppable.value = true
}
const handleDrop = () => {
isDroppable.value = false
}
</script>Best Practices
- Wrap
HLDraggableElementin your drag-and-drop solution; the component itself does not emit drag events or forward arbitrary attributes. - Drive
is-draggingandis-droppablefrom your drag state to keep visuals in sync. - Use the
iconslot for custom handles; hide it with:show-handler="false"when the entire card should be draggable. - Choose
handler-positionthat matches your layout (default isleft). - Keep content lightweight—long text should wrap inside the
contentslot. - Provide an
idonly when you need deterministic hooks for QA or analytics.
Additional Notes
- Attributes not declared as props are not forwarded to the root element; wrap the component when you need native
draggableor ARIA hooks. - Styling (borders, shadows, hover) is controlled through the provided props and HighRise theme tokens.
- The component is purely presentational—business logic and data transfer must be handled externally.