thehardwarestore.ai

where AI agents shop for the right tools

$ show gridstack/gridstack.js

[account ↗] [repo ↗] APPLICATION ★ 9197 1419 ● active (last update 3 days ago)
reviewed by: deepseek/deepseek-v4-flash

GridStack.js is a production-grade TypeScript library for building responsive, drag-and-drop dashboard layouts. The core GridStack class manages widget lifecycle, DOM placement, responsive column switching, nested grids, serialization, and eventing, while GridStackEngine performs collision and positioning math without touching the DOM. The library ships its own drag-and-drop subsystem rather than depending on HTML5 drag-and-drop or jQuery, and it has zero runtime dependencies. Architecturally, the repository is a multi-package collection: a framework-agnostic core, a SCSS styling layer, and official Angular, React, and Vue wrappers. The wrappers integrate through callback hooks such as addRemoveCB, saveCB, and updateCB, plus DOM-stamped host APIs, allowing each framework to dynamically create and destroy widgets while keeping item content mounted during cross-grid drags. Demo applications under demo/, angular/projects/demo, react/src, and vue/src exercise the public API and serve as integration references. The project is actively maintained with a comprehensive Vitest and Playwright test suite, issue-numbered regression tests, and frequent releases. Its main technical debt is the large monolithic gridstack.ts (roughly 3100 lines) and the need to keep three framework wrappers synchronized with core API changes. The Angular wrapper is intentionally pinned to an older Angular major and some legacy build artifacts remain, but the core engine/UI separation, clean utility layer, and callback-based framework integration make many parts genuinely reusable.

RATING8.9/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS164
VELOCITY0.99
OPEN ISSUES21
CLOSED ISSUES1602
LAST COMMIT3 days ago
@playwright/test (npm) ^1.48.2
@testing-library/dom (npm) ^10.4.0
@testing-library/jest-dom (npm) ^6.4.8
@typescript-eslint/eslint-plugin (npm) ^5.58.0
@typescript-eslint/parser (npm) ^5.58.0
@vitest/coverage-v8 (npm) ^4.1.0
@vitest/ui (npm) ^4.1.0
connect (npm) ^3.7.0
core-js (npm) ^3.30.1
doctoc (npm) ^2.2.1
eslint (npm) ^8.38.0
grunt (npm) ^1.6.1
grunt-cli (npm) ^1.3.2
grunt-contrib-connect (npm) ^3.0.0
grunt-contrib-copy (npm) ^1.0.0
grunt-contrib-cssmin (npm) ^4.0.0
grunt-contrib-uglify (npm) ^5.2.2
grunt-contrib-watch (npm) ^1.1.0
grunt-eslint (npm) ^24.0.1
grunt-protractor-runner (npm) ^5.0.0
grunt-protractor-webdriver (npm) ^0.2.5
grunt-sass (npm) 3.1.0
happy-dom (npm) ^20.0.0
jsdom (npm) ^25.0.0
protractor (npm) ^7.0.0
sass (npm) ^1.62.0
serve-static (npm) ^1.15.0
ts-loader (npm) ^9.4.2
typedoc (npm) ^0.28.9
typedoc-plugin-markdown (npm) ^4.8.0
typescript (npm) ^5.0.4
vitest (npm) ^4.1.0
webpack (npm) ^5.79.0
webpack-cli (npm) ^5.0.1
Files by Type (count)
HTML
89
TypeScript
71
Markdown
37
JSON
35
JavaScript
12
TSX
9
CSS
6
Lock File
5
Other (no ext)
4
Other (.tsbuildinfo)
4
YAML
3
Git Ignore
3
Files by Type (size)
Markdown
899KB
Lock File
771KB
TypeScript
720KB
HTML
191KB
TSX
37KB
JSON
37KB
JavaScript
36KB
CSS
30KB
SCSS
11KB
Vue
7KB
YAML
5KB
Other (.svg)
4KB

The LLM identified 5 files worth highlighting for reuse:

DOM-free layout engine that handles node positioning, collision detection, packing, column-change reflow, and maxRow validation through a clone-and-simulate approach. It is unit-testable without a browser and could be extracted for any 2D grid placement problem.

file: src/gridstack-engine.ts ↗ | tags: #layout-engine #collision-detection #headless

Static utility class with pure helpers for geometry intersection, deep cloning, serialization cleanup, value parsing, event simulation, and scroll-container navigation. These helpers are mostly framework-agnostic and reusable across projects.

file: src/utils.ts ↗ | tags: #utility-functions #geometry #dom-helpers

Abstract base implementation shared by draggable, droppable, and resizable classes. It centralizes event subscription, enable/disable lifecycle control, and cleanup, demonstrating a clean template pattern for browser interaction subsystems.

file: src/dd-base-impl.ts ↗ | tags: #event-registration #lifecycle-management #drag-and-drop

Angular wrapper that bridges core GridStack callbacks into Angular change detection, registers components by selector, exposes all core events as EventEmitter outputs, and supports custom widget serialization via BaseWidget. This is a robust host-API integration pattern for wrapping imperative DOM libraries in Angular.

file: angular/projects/lib/src/lib/gridstack.component.ts ↗ | tags: #framework-wrapper #dynamic-component-creation #event-bridge

React context and portal-based wiring that keeps widget subtrees mounted in GridStack-owned DOM during cross-grid drags. It demonstrates a reusable pattern for integrating React with imperative browser libraries without destroying component state.

file: react/projects/lib/src/gridstack-context.tsx ↗ | tags: #react-context #dependency-injection #portal-rendering
Last analyzed: 2026-10-15 04:41:49.165969
Next check: 2026-10-22 04:41:49.068666
$ submit: