npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@appulsauce/svelte-grid

v2.0.2

Published

A draggable and resizable grid layout, for Svelte 5

Downloads

238

Readme

@appulsauce/svelte-grid

A draggable and resizable grid layout component for Svelte 5.

npm version license

Installation

npm install @appulsauce/svelte-grid

Quick Start

<script lang="ts">
	import Grid, { GridItem, type GridController } from '@appulsauce/svelte-grid';

	let items = $state([
		{ id: '1', x: 0, y: 0, w: 2, h: 2 },
		{ id: '2', x: 2, y: 0, w: 3, h: 1 }
	]);

	let gridController: GridController;

	function addItem() {
		const position = gridController.getFirstAvailablePosition(2, 2);
		if (position) {
			items = [...items, { id: crypto.randomUUID(), ...position, w: 2, h: 2 }];
		}
	}

	const itemSize = { height: 50 };
</script>

<button onclick={addItem}>Add Item</button>

<Grid {itemSize} cols={10} collision="push" bind:controller={gridController}>
	{#each items as item (item.id)}
		<GridItem id={item.id} bind:x={item.x} bind:y={item.y} bind:w={item.w} bind:h={item.h}>
			{#snippet children()}
				<div class="item">{item.id}</div>
			{/snippet}
		</GridItem>
	{/each}
</Grid>

Features

  • Draggable & Resizable - Move and resize grid items with mouse or touch
  • Collision Detection - Three modes: none, push, compress
  • Two-way Binding - Bind item positions directly to your state
  • Custom Handles - Use snippets for custom move/resize handles
  • Grid Controller - Programmatic control with getFirstAvailablePosition() and compress()
  • TypeScript - Full type support included

Documentation

For full documentation and examples, visit the docs site or run the docs locally:

# Clone the repository
git clone https://github.com/KaiErikNiermann/svelte-grid-extended.git
cd svelte-grid-extended

# Install dependencies
pnpm install
pnpm docs:install

# Run docs site
pnpm docs:dev

API Overview

Grid Props

| Prop | Type | Default | Description | | ----------- | -------------------------------- | -------- | -------------------------------- | | cols | number | 0 | Number of columns (0 = infinite) | | rows | number | 0 | Number of rows (0 = infinite) | | itemSize | { width?, height? } | {} | Fixed cell size in pixels | | gap | number | 10 | Gap between items | | collision | 'none' \| 'push' \| 'compress' | 'none' | Collision behavior | | readOnly | boolean | false | Disable all interactions |

GridItem Props

| Prop | Type | Default | Description | | ----------- | --------- | -------- | ------------------------ | | x | number | required | X position in grid units | | y | number | required | Y position in grid units | | w | number | 1 | Width in grid units | | h | number | 1 | Height in grid units | | movable | boolean | true | Can be dragged | | resizable | boolean | true | Can be resized |

Requirements

  • Svelte 5.0.0+

License

MIT

Acknowledgments

  • Forked from https://github.com/cuire/svelte-grid-extended
  • Original project: https://github.com/valqelyan/svelte-grid