vue3-grid-layout-next

A draggable and resizable grid layout, as a Vue component.
773,720 129
Install
npm install vue3-grid-layout-next
Latest Version:1.0.7
Vue:3
License:MIT
Last Updated:Aug 1, 2025
Links: GitHub  ·  npm
Maintainer: xhlife

Support By

This project js support by vue-grid-layout, but vue-grid-layout do not support vue3.

Vue 3 + TypeScript + Vite

The template uses Vue 3 <script setup> SFCs, so pay attention to the version of vue.

Supports Vue 3.2+

Usage

npm i vue3-grid-layout-next

add Scoped slot

<grid-item v-slot="{style}">
  <div>
    <!-- get attribute, such as width,height, and so no  -->
    {{ style }}
  </div>
</grid-item>

add dragging、 dragend event

<grid-item
  @dragging="doSomething"
  @dragend="doSomethingEnd"
  >
</grid-item>

<script lang="ts" setup> 

  function doSomethin(event: MouseEvent, i: number | string) {
    
  }
</script>

beware

Usage with v-model

 <GridLayout v-model:layout="layout">
  ...
 </GridLayout>

Use ref object

If the responsive property is true, make sure layout is a ref object

<script lang="ts" setup> 

  const responsive = ref(true)
  const layout = ref([])
  // const layout = reactive([]) // will cause some bug

  // it will work, when responsive is false
  // const layout = reactive([])

</script>

<template>
  <div class="layout">
    <GridLayout v-model:layout="layout" :responsive="responsive" >
      ...
    </GridLayout>
  </div>
</template>

example

demo for echart - source:https://gitee.com/cxid/vue3-grid-layout-demo

Related Packages

vue-grid-layout

A draggable and resizable grid layout, as a Vue component.

2,102,559 7,398
vue-grid-layout-v3

A draggable and resizable grid layout, as a Vue component.

429,159 113
@corvina/vue-grid-layout

A draggable and resizable grid layout, as a Vue component.

4,536 0
@widgetti/vue-grid-layout

A draggable and resizable grid layout, as a Vue component.

2,224 0
vue3-grid-layout-ts

A draggable and resizable grid layout, as a Vue component.

2,063

Version History

Version Released License
1.0.7 MIT
1.0.6 MIT
1.0.5 MIT
1.0.4 MIT
1.0.3 MIT