re-resizable

A dependency-free React component that adds drag-to-resize handles, grid snapping, and aspect-ratio locking to any element.

Library
npm
v6.11.2
2,666stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
48/100Fair
Development Activity12
Maintenance20
Community60
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
68/100Good
Architecture75
Code Quality78
Innovation55
Learning Curve65

re-resizable is a React component library that wraps any child content in a resizable box, exposing eight drag handles (four edges, four corners) for freeform or constrained resizing. It ships as a single dependency-free package — no runtime dependencies beyond React itself — and supports both controlled (size) and uncontrolled (defaultSize) usage, matching how the rest of a typical React app already manages state.

Beyond basic drag-resize, it handles the edge cases teams tend to hand-roll themselves: aspect-ratio locking (with extra width/height for adjacent sidebars or headers), grid and snap-point resizing, resize boundaries scoped to the window, the parent, or an arbitrary element, and correct behavior inside CSS-scaled ancestors via a scale prop. An imperative updateSize instance method lets consumers resize programmatically outside the normal props flow.

What You Get

  • Eight-direction resize handles (edges + corners) with per-direction enable/disable control
  • Controlled and uncontrolled size APIs (size vs defaultSize) with resize start/move/stop callbacks
  • Grid, snap-point, and aspect-ratio-lock resize constraints, including bounds scoped to window, parent, or element
  • Zero runtime dependencies and a small footprint, shipped as both ES5 and ESM builds
  • Full TypeScript types and an imperative updateSize API for programmatic resizing

Common Use Cases

  • Resizable side panels and dashboard widgets
  • User-resizable image/video/media containers that preserve aspect ratio
  • Split-pane / IDE-style layouts with draggable dividers
  • Resizable text areas, chat boxes, or embeds with min/max size constraints

Under The Hood

Architecture The library centers on a single Resizable class component (src/index.tsx, extending PureComponent) that owns all resize state — original pointer position, original size, active direction, and an isResizing flag — and delegates the eight visual drag handles to a small memoized Resizer function component (src/resizer.tsx) that just wires onMouseDown/onTouchStart per direction. Rather than relying on React’s synthetic events for drag tracking, Resizable attaches mousemove/mouseup/touchmove/touchend listeners directly to window in componentDidMount, and mutates the wrapper’s DOM style imperatively via a ref during drag (wrapping updates in flushSync from react-dom to force synchronous, tear-free commits mid-drag). This keeps resize math — grid/snap clamping, aspect-ratio locking, boundary calculation — concentrated in a handful of instance methods (calculateNewMax, calculateNewMaxFromBoundary), which is easy to reason about but means the freeform, grid-snapped, aspect-locked, and bounded resize modes all share the same code path, so a change to the core clamping logic risks affecting all of them at once.

Tech Stack Written in strict TypeScript with React as the only peer dependency (supporting 16.13 through 19), and zero runtime dependencies otherwise. Built with Rollup (rollup-plugin-typescript2, Babel plugins) into parallel ES5 and ESM (lib/index.es5.js, lib/index.js) bundles, distributed via files: ["lib"]. Package management and CI use pnpm; Storybook powers the live demo, deployed to GitHub Pages via gh-pages.

Code Quality The project has a substantial Playwright component-test suite (src/index.spec.tsx, using @playwright/experimental-ct-react and sinon for spies) covering sizing modes, relative units (vw/vh/vmin/vmax), and callback behavior. tsconfig.json runs in strict mode, and CI (GitHub Actions) runs three separate jobs — lint, tsc, and test — on every push and PR. Linting still uses legacy tslint rather than eslint, which is dated but functional and paired with Prettier for formatting.

What Makes It Unique Resizable wrapper components are a well-trodden pattern (react-rnd, interact.js, and similar libraries all solve the same problem), so the core idea isn’t novel. What distinguishes this implementation is its attention to detail: zero runtime dependencies, careful handling of relative units (percentages, vw/vh/vmin/vmax) for both size and min/max constraints rather than pixels only, a scale prop that corrects resize math when nested inside a CSS-transformed ancestor, and lockAspectRatioExtraWidth/Height for keeping media aspect-locked alongside a fixed-size sidebar or header — the kind of edge cases most hand-rolled resize implementations miss.

Used by 17 apps in this directory

TypeScript
94%
MIT

Actual

Invoicing Finance

28,593

Local-first personal finance with envelope budgeting, end-to-end encryption, and multi-device sync — no subscription required.

View details
93
Repo Health
85
Technical
77
Dependency
Built with
TypeScript94%
Updated today
TypeScript
99%
Apache 2.0

Colanode

Knowledge Management · Team Chat · Collaboration

5,097

Local-first, self-hosted workspace that combines real-time chat, Notion-style pages, and structured databases — all synced via CRDTs so you work offline without losing a keystroke.

View details
47
Repo Health
73
Technical
70
Dependency
Built with
TypeScript99%
Updated 5 months ago
TypeScript
94%
AGPL 3.0

Element Web

Team Chat · Collaboration

13,437

A polished, self-hostable Matrix client for secure, decentralized messaging and collaboration that puts your organization in full control of its data.

View details
96
Repo Health
83
Technical
65
Dependency
Built with
TypeScript94%
Updated yesterday
TypeScript
49%
AGPL 3.0

Grafana

Monitoring · Analytics

76,643

The open-source observability platform that unifies metrics, logs, and traces from any data source into dynamic, queryable dashboards.

View details
95
Repo Health
91
Technical
63
Dependency
Built with
TypeScript49%
Go45%
Updated today
TypeScript
91%
Apache 2.0

Helicone

Monitoring · AI Development · Analytics

6,133

An open-source AI gateway and LLM observability platform that routes requests to 100+ models while logging cost, latency, and full traces for every call.

View details
69
Repo Health
81
Technical
65
Dependency
Built with
TypeScript91%
Updated 1 weeks ago
TypeScript
100%
Apache 2.0

ILLA Builder

Developer Tools · Low Code Platforms · No Code Platforms

12,312

Open-source low-code platform for building internal tools with drag-and-drop UI, reactive data bindings, and real-time collaboration.

View details
57
Repo Health
71
Technical
63
Dependency
Built with
TypeScript100%
Updated 3 months ago
TypeScript
76%
Other

Joplin

Note Taking

56,257

The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.

View details
93
Repo Health
87
Technical
61
Dependency
Built with
TypeScript76%
JavaScript14%
Updated yesterday
TypeScript
65%
Apache 2.0

Laminar

AI Development · Monitoring

3,230

Open-source observability platform purpose-built for AI agents — trace, evaluate, debug, and monitor at scale with SQL access and real-time replay.

View details
85
Repo Health
76
Technical
69
Dependency
Built with
TypeScript65%
Rust33%
Updated yesterday
Python
51%
AGPL 3.0

LearnHouse

Learning Management · CMS

2,240

Open-source LMS with AI tutoring, real-time collaboration boards, live code execution, and built-in course monetization — self-hosted in minutes.

View details
90
Repo Health
77
Technical
66
Dependency
Built with
Python51%
TypeScript48%
Updated yesterday

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

Search