Skip to content
CAI
Software that uses CAICheck a score

react-grid-layout/react-draggable

66.6

Adequate · 2 October 2026

2.1k

lines of production code

TypeScript

with JavaScript

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a React library that provides draggable UI components, specifically exposing Draggable and DraggableCore elements for handling user interaction. It supports advanced features such as axis constraints, grid snapping, bounds clipping, and touch events, while ensuring compatibility with modern React versions. The library is engineered for robustness, offering Content Security Policy nonce support and defensive guards for server-side rendering environments.

Features

TypeScript type definitions and validation tests added

The library now includes TypeScript type definitions and a dedicated typings folder containing a test file and configuration files to validate the public API. The test file verifies that props such as allowMobileScroll, nodeRef, and positionOffset are correctly typed for Draggable and DraggableCore components, ensuring type safety for consumers using both React 18 and React 19.

typings · high confidence

Behavioural changes

Build system migrated to TypeScript with Vitest and tsup

The project has migrated its source code from Flow to TypeScript and replaced the Karma/Jasmine test runner with Vitest. The build process now uses tsup to generate CommonJS, ESM, and TypeScript declaration files, while Webpack is retained solely for the UMD bundle. This change introduces a new ESLint flat config, updates the CI configuration to use Node 10 and 12, and adds a \.browserslistrc\ file to define supported browser versions.

(repo-wide) · high confidence

Example app updated to a cyberpunk theme with React 18

The example application has been completely restyled with a new cyberpunk visual theme (dark background, neon accents, and specific fonts) and upgraded to use React 18 via CDN. The previous minimal example entry point has been replaced by a comprehensive demo page showcasing various Draggable configurations, including axis constraints, grid snapping, bounds, handles, controlled positioning, and drop detection.

example · high confidence

Migrate library source to TypeScript and add CSP nonce support

The internal utility modules in lib/utils have been rewritten from Flow to TypeScript, introducing strict type definitions for drag events, positions, and bounds. This migration includes a new feature for Content Security Policy compliance: the library now supports injecting a nonce into its dynamically created style element (used to prevent text selection during dragging) via an explicit prop or by reading the webpack \_\_webpack\nonce\\_ variable. Additionally, the codebase now includes defensive guards for browser-only APIs (like window and process) to prevent crashes in server-side or non-browser bundling environments.

lib/utils · high confidence

Migration to TypeScript and modern React component architecture

The library source has been rewritten from legacy ES5 React.createClass components to modern ES6 classes in TypeScript (Draggable.tsx, DraggableCore.tsx). This introduces a new \<DraggableCore\> component for advanced usage, adds support for touch events and grid snapping, and allows specifying a drag handle or cancel selector. The legacy lib/draggable.js, lib/main.js, and lib/styles.css files have been removed in favor of the new TypeScript implementation and entry points (cjs.ts, umd.ts).

lib · high confidence

New release and build verification scripts enforce stricter publishing and contract checks

Added \scripts/check-release.cjs\ to prevent publishing from dirty trees, detached HEAD, or non-fast-forward states, and to verify the version is not already on npm. Added \scripts/verify-build.cjs\ to assert that CJS exports return the component directly, UMD bundles expose the \ReactDraggable\ global, generated \.d.ts\ files do not leak \prop-types\ dependencies, browser-facing bundles contain no unguarded \process\ references, and ESM consumers receive correct ESM type declarations via the \exports\ map.

scripts · high confidence

Test coverage

Added browser-based integration tests for React Draggable; Added comprehensive test suite for Draggable and DraggableCore; Added comprehensive unit tests for utility functions and migrated test runner to Vitest.

Dependencies

Upgrade to React 19 and modernize build/test infrastructure

The project has upgraded its development dependencies to React 19 and React DOM 19, alongside a comprehensive migration of the build and test tooling. The build system now uses TypeScript, tsup, and webpack 5, replacing the previous Babel/Rollup setup, and the test suite has moved from Karma/Jasmine to Vitest with JSDOM and Puppeteer for browser testing. The package exports are now structured to support modern ESM and CommonJS consumers with explicit type definitions, and the published files are organized under a new \build\ directory structure.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 66 → 67 (+0.8)
  • Rubric changed (rubric-2026.09.12 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 75 → 75 (+0.0)
  • Architecture 94 → 96 (+1.2)
  • Maturity 61 → 61 (+0.1)
  • Readiness 62 → 64 (+1.8)
  • Security 75 → 78 (+3.2)

Resolved (6)

  • Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (no pnpm-resolved versions to grade)
  • Documentation: no usage examples (README.md)
  • High CVE: [GHSA redacted] (yarn.lock)
  • High CVE: [GHSA redacted] (yarn.lock)
  • Hotspot: lib/DraggableCore.tsx (lib/DraggableCore.tsx)
  • Off-boarding risk: anonymized user #1

New (5)

  • Documentation: no project overview (README.md)
  • High CVE: [GHSA redacted] (yarn.lock)
  • High CVE: [GHSA redacted] (yarn.lock)
  • High CVE: [GHSA redacted] (yarn.lock)
  • Off-boarding risk: anonymized user #1

Changes since last survey

  • 1 commits — 1 feature/other, 0 fixes

By area

  • .out-of-scope/auto-scroll.md — 1 commit

Notable commits

  • change: docs: record out-of-scope feature requests from issue triage (#824)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

react-grid-layout/react-draggable was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 2 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 40829e3eae98ff91d0219d7648c2aa431cbdfefb — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.