Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

colaberry/gridstack-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

1 Commit

Repository files navigation

GridStack.js Examples

This directory contains working examples of GridStack.js - a modern TypeScript library for creating responsive, drag-and-drop dashboard layouts.

๐Ÿ“ฆ Contents

1. gridstack-example.html - Basic Interactive Dashboard

A simple, beginner-friendly example demonstrating:

  • โœ… Drag and drop widgets
  • โœ… Resize widgets
  • โœ… Add new widgets dynamically
  • โœ… Save/Load layouts to localStorage
  • โœ… Clear grid
  • โœ… Toggle float mode

Just open this file in your browser to see it in action!

2. gridstack-advanced.html - Dashboard Builder with Sidebar

A more advanced example featuring:

  • โœ… Drag widgets from a sidebar library
  • โœ… Multiple widget types (Stats, Charts, Tables, Text)
  • โœ… Delete widgets by dragging to trash zone
  • โœ… Close button on each widget
  • โœ… Export layout as JSON
  • โœ… Professional styling and animations

3. gridstack.js/ - Official Repository

The complete cloned repository from GitHub containing:

  • Source code
  • 40+ demo examples
  • TypeScript definitions
  • Angular, React, Vue wrappers

๐Ÿš€ Quick Start

Option 1: Open HTML Files Directly

Simply double-click either HTML file to open it in your browser. No build process needed!

# macOS
open gridstack-example.html
open gridstack-advanced.html
# Linux
xdg-open gridstack-example.html
# Windows
start gridstack-example.html

Option 2: Use a Local Server

For better testing, use a local server:

# Using Python 3
python3 -m http.server 8000
# Using Node.js (npx)
npx serve
# Then open: http://localhost:8000

๐Ÿ“š Key Features Demonstrated

GridStack.js v12.4.2 Features:

  • Drag & Drop: Move widgets around the grid
  • Resize: Adjust widget dimensions
  • Responsive: Auto-adjust on mobile devices
  • Persistence: Save/load layouts
  • No Dependencies: Pure TypeScript/JavaScript
  • Framework Support: Works with React, Angular, Vue, etc.

๐ŸŽฎ How to Use

Basic Example:

  1. Drag any widget to move it
  2. Resize by dragging the edges
  3. Click "Add Widget" to create new widgets
  4. Click "Save Layout" to store in browser
  5. Click "Load Layout" to restore saved layout
  6. Toggle float mode to change stacking behavior

Advanced Example:

  1. Drag widgets from the left sidebar to the grid
  2. Remove widgets by clicking the ร—ใฐใค button
  3. Delete by dragging widgets to the trash zone
  4. Export layout as a JSON file
  5. Different widget types: Stats, Charts, Tables, Text

๐Ÿ“– API Highlights

// Initialize grid
const grid = GridStack.init({
 float: true,
 cellHeight: 80,
 minRow: 3,
 margin: 10
});
// Add widget
grid.addWidget({
 w: 2, // width (in columns)
 h: 2, // height (in rows)
 x: 0, // x position
 y: 0, // y position
 content: '...' // HTML content
});
// Save layout
const layout = grid.save();
localStorage.setItem('layout', JSON.stringify(layout));
// Load layout
const savedLayout = JSON.parse(localStorage.getItem('layout'));
grid.load(savedLayout);
// Remove widget
grid.removeWidget(element);

๐Ÿ”— Resources

๐Ÿ“ Version Info

  • GridStack.js Version: 12.4.2 (latest as of February 2026)
  • License: MIT
  • Browser Support: Modern browsers (Chrome, Firefox, Safari, Edge)

๐Ÿ’ก Next Steps

Explore the official demos in gridstack.js/demo/ directory:

  • nested.html - Nested grids
  • responsive.html - Responsive layouts
  • serialization.html - Save/load complex layouts
  • react.html, vue3js.html, knockout.html - Framework integrations

๐Ÿ› ๏ธ Customization

Both examples use CDN links for easy setup. For production:

npm install gridstack

Then import in your project:

import 'gridstack/dist/gridstack.min.css';
import { GridStack } from 'gridstack';

โญ Key Differences from jQuery Version

GridStack v2.0+ removed jQuery dependency:

  • โœ… Pure TypeScript/JavaScript
  • โœ… Smaller bundle size
  • โœ… Better performance
  • โœ… Native ES6 modules
  • โœ… TypeScript support out of the box

Enjoy building with GridStack.js! ๐ŸŽ‰

About

GridStack test with SHIPCES micro-widget architecture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

AltStyle ใซใ‚ˆใฃใฆๅค‰ๆ›ใ•ใ‚ŒใŸใƒšใƒผใ‚ธ (->ใ‚ชใƒชใ‚ธใƒŠใƒซ) /