cuire / svelte-grid-extended

A draggable and resizable grid layout, for Svelte
https://svelte-grid-extended.vercel.app
MIT License
78 stars 9 forks source link

Enable custom attributes on items #10

Closed yoh-extradat closed 1 year ago

yoh-extradat commented 1 year ago

It would be super helpful to enable custom attributes on items. For example to enable dragging and dropping custom components to a grid like this:

<script>
import DataTable from "..."
const items = [{
       { id: '0', x: 0, y: 0, w: 1, h: 1, component:{type: DataTable, properties:{ ... } } }
}]
</script>

<Grid {items} cols={10} rows={10} let:item>
       <svelte:component this={item.component.type} {...item.component.properties} />
</Grid>
cuire commented 1 year ago

Hi. I'll add it in next release.