react-grid-layout

A responsive, draggable, and resizable grid layout system for React with breakpoints and zero jQuery.

Library
npm
v2.3.0
22,470 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
91 /100 Excellent
Development Activity 96
Maintenance 84
Community 84
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
88 /100 Excellent
Architecture 90
Code Quality 88
Innovation 85
Learning Curve 70

React Grid Layout is a grid layout system for React that lets users drag, resize, and rearrange widgets on a responsive canvas. It powers dashboards and drag-and-drop editors at companies like Grafana, Metabase, Kibana, and BitMEX, offering breakpoint-aware layouts, bounds checking, and serializable state without any jQuery dependency.

Version 2 is a complete TypeScript rewrite with first-class types, React hooks (useContainerWidth, useGridLayout, useResponsiveLayout), a tree-shakeable modular architecture, and a framework-agnostic core of pure layout algorithms. A legacy entry point preserves 100% runtime compatibility with the widely used v1 flat-props API.

What You Get

  • A drop-in <ReactGridLayout> component that turns child elements into draggable, resizable grid widgets
  • Responsive breakpoint support with independent layouts per breakpoint and auto-generated fallbacks
  • React hooks (useContainerWidth, useGridLayout, useResponsiveLayout) for width measurement and layout state
  • A framework-agnostic /core module exposing pure collision, compaction, and positioning algorithms
  • A /legacy entry point giving 100% runtime compatibility with the v1 flat-props API for painless migration

Common Use Cases

  • Building customizable, user-rearrangeable analytics dashboards
  • Creating drag-and-drop page or form builders
  • Persisting and restoring per-user widget layouts across sessions and screen sizes
  • Composing responsive widget grids that reflow across breakpoints

Under The Hood

Architecture

The library is organized into layered modules under src/: a pure, React-free core/ (collision.ts, compactors.ts, constraints.ts, layout.ts, position.ts, calculate.ts, responsive.ts) that implements collision detection, compaction, and grid-cell math; a react/ layer with the GridLayout, ResponsiveGridLayout, GridItem, and WidthProvider components plus hooks; an extras/ module for optional pieces like GridBackground and fast O(n log n) compactors; and a legacy/ wrapper reproducing the v1 flat-props surface. Grid items are positioned with CSS transforms (or absolute positioning via a pluggable position strategy), and dragging/resizing is delegated to react-draggable and react-resizable.

Tech Stack

Written in TypeScript (57%) with remaining JavaScript, built with tsup into tree-shakeable ESM and CJS bundles with generated .d.ts types. Runtime dependencies are minimal: clsx, fast-equals, prop-types, react-draggable, react-resizable, and resize-observer-polyfill. React >= 16.3 is a peer dependency, with v2 targeting React 18+. Tooling includes Babel, Jest, ESLint (flat config), Prettier, Husky, and webpack for the examples site.

Code Quality

The repository has an extensive Jest test suite under test/spec/ covering compactors, constraints, core functions, hooks, lifecycle, drop alignment, margin consistency, TypeScript component typing, and backward compatibility, plus benchmark tests. Code is strongly typed with a clean separation between pure algorithms and React bindings, and exported surfaces are deliberately curated (some internal helpers are intentionally not exported). This is a mature, well-tested codebase.

API Design The v2 API groups related props into focused config objects (gridConfig, dragConfig, resizeConfig, positionStrategy, compactor) rather than a flat prop soup, and pairs them with ergonomic hooks so container width and layout state are easy to wire up. Documentation is thorough: a large README with 20+ live demos, a migration guide, an RFC, and a CodeSandbox. The legacy wrapper lowers migration cost significantly. The main tradeoff is that the required width prop and breakpoint concepts impose a modest learning curve for newcomers.

Used by 27 apps in this directory

Python
57%
Other

Sentry

Analytics · Developer Tools · Monitoring

45,632

Developer-first error tracking and performance monitoring platform with AI-powered root-cause analysis across 20+ languages and frameworks.

View details
95
Repo Health
80
Technical
66
Dependency
Built with
Python 57%
TypeScript 42%
Updated 5 days ago
TypeScript
50%
Other

SigNoz

Analytics · Monitoring

32,429

Self-host your entire observability stack — logs, metrics, traces, and LLM monitoring — in one OpenTelemetry-native platform, without the Datadog bill.

View details
92
Repo Health
83
Technical
64
Dependency
Built with
TypeScript 50%
Go 38%
Updated 6 days ago
TypeScript
72%
Apache 2.0

Supabase

Authentication · Databases · Developer Tools

113,827

The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.

View details
90
Repo Health
91
Technical
62
Dependency
Built with
TypeScript 72%
MDX 26%
Updated 5 days ago
TypeScript
98%
Apache 2.0

superlog

AI Agents · Monitoring

1,469

Open-source agentic observability that ingests OpenTelemetry signals, groups them into incidents, and deploys AI agents to investigate and fix your production bugs automatically.

View details
66
Repo Health
73
Technical
72
Dependency
Built with
TypeScript 98%
Updated 6 days ago
TypeScript
99%
Other

Teable

Databases · No Code Platforms

21,920

A no-code PostgreSQL database with spreadsheet UX, real-time collaboration, and native AI agents — built for teams that outgrow Airtable.

View details
78
Repo Health
76
Technical
62
Dependency
Built with
TypeScript 99%
Updated 6 days ago
TypeScript
98%
Apache 2.0

Tianji

Analytics · Monitoring

3,119

Replace Google Analytics, UptimeKuma, and Prometheus with one self-hosted platform that tracks websites, monitors uptime, and reports server health.

View details
86
Repo Health
76
Technical
64
Dependency
Built with
TypeScript 98%
Updated 6 days ago
TypeScript
99%
Apache 2.0

Trigger.dev

AI Development · Automation · Developer Tools

16,606

Build and deploy fully-managed AI agents and background jobs in TypeScript — with no timeouts, durable retries, real-time observability, and elastic scaling built in.

View details
90
Repo Health
9
Technical
63
Dependency
Built with
TypeScript 99%
Updated 5 days ago
TypeScript
84%
Other

twenty

CRM

59,615

The open-source CRM you build, ship, and version like the rest of your stack — with customizable objects, AI agents, and a TypeScript SDK.

View details
92
Repo Health
82
Technical
64
Dependency
Built with
TypeScript 84%
MDX 14%
Updated 6 days ago
TypeScript
97%
Apache 2.0

Unleash

Ab Testing Experimentation · Developer Tools · Devops

13,899

The open-source feature management platform that lets you ship code to production and control who sees it — without redeploying.

View details
91
Repo Health
84
Technical
69
Dependency
Built with
TypeScript 97%
Updated 6 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers