react-virtualized-auto-sizer

Measures a container's available width/height and passes it to a child component

Library
npm
v2.0.3
672stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
43/100Fair
Development Activity8
Maintenance20
Community56
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
75/100Good
Architecture74
Code Quality78
Innovation58
Learning Curve88

react-virtualized-auto-sizer measures the available width and height of its parent HTMLElement and passes those dimensions as props to a child render function or component. It began as the AutoSizer component extracted from the original react-virtualized library and was made standalone for use with react-window, giving virtualization libraries — and any component that needs to fill and react to its container’s dimensions — a reliable, dependency-free way to know how much space is available.

The library exposes both a classic render-prop <AutoSizer> component and a useSize hook for measuring an element imperatively, built on native ResizeObserver under the hood. The maintainer notes that newer versions of react-window use ResizeObserver directly and no longer need this package, but it remains widely used by other virtualization and layout code that hasn’t made that jump.

What You Get

  • An <AutoSizer> render-prop component that reports {width, height} of its parent container
  • A useSize hook for measuring an element’s dimensions directly in function components
  • Options to disable width or height measurement independently (disableWidth/disableHeight)
  • A defaultWidth/defaultHeight fallback for consistent server-side rendering output
  • Built on native ResizeObserver rather than polling or window-resize listeners

Common Use Cases

  • Sizing a react-window or react-virtualized list/grid to exactly fill its parent container
  • Making any fixed-size chart, canvas, or map component responsive to its flex/grid container
  • Building resizable dashboard panels where child content needs to know the panel’s current pixel dimensions
  • Measuring a container for responsive layout decisions without hardcoding breakpoints

Under The Hood

Architecture The published package’s core lives in lib/components/AutoSizer.tsx (71 lines), a thin component that renders a full-size wrapper div and delegates the actual measuring logic to the useSize hook in lib/hooks/useSize.ts (153 lines), which sets up a ResizeObserver on the wrapper element and returns its current {width, height} reactively; lib/vendor/detectElementResize.js retains a legacy resize-detection fallback vendored from the original react-virtualized implementation for environments without ResizeObserver. The repository is a monorepo-shaped workspace where lib/ is the actual publishable library and src/, index.tsx, and vite.config.ts build the project’s documentation/demo site (deployed to Vercel) — the demo site is not part of the npm package. Tech Stack TypeScript throughout, built with Vite/pnpm workspaces, using native browser ResizeObserver as the sole measurement mechanism with no runtime dependencies beyond React itself as a peer dependency. Code Quality lib/components/AutoSizer.test.tsx and a lib/utils/test directory cover the core measuring behavior, tested via Vitest (vitest.config.ts, vitest.setup.ts); the project maintains a documented FAQ and example site alongside the code, and CHANGELOG.md tracks releases carefully given the library’s role as infrastructure for other virtualization packages. API Design The API is intentionally minimal — a single <AutoSizer> component taking a render-prop child plus a handful of boolean/number options, and an equivalent useSize hook for hook-based code — making integration a one-line wrap around existing virtualized-list code with almost no configuration required.

Used by 16 apps in this directory

TypeScript
94%
MIT

Actual

Invoicing Finance

28,224

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 yesterday
TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
Go
76%
AGPL 3.0

Coder

Devops · Developer Tools · Code Editors

14,199

Self-hosted cloud development environments and AI coding agents — defined in Terraform, connected via WireGuard, automatically shut down when idle.

View details
93
Repo Health
90
Technical
71
Dependency
Built with
Go76%
TypeScript22%
Updated today
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,633

Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.

View details
65
Repo Health
76
Technical
63
Dependency
Built with
JavaScript90%
Updated 1 months ago
TypeScript
45%
Other

Convex Backend

Developer Tools · Databases

12,394

Open-source reactive database that lets developers build live-updating apps with pure TypeScript, strong consistency, and real-time subscriptions—no separate API layer required.

View details
88
Repo Health
82
Technical
70
Dependency
Built with
TypeScript45%
Rust43%
Updated today
TypeScript
100%
Other

Dub

Marketing · Analytics

24,521

The open-source link attribution platform for short links, conversion tracking, and affiliate programs — powering 100M+ clicks monthly.

View details
81
Repo Health
78
Technical
65
Dependency
Built with
TypeScript100%
Updated today
TypeScript
48%
AGPL 3.0

Grafana

Monitoring · Analytics

76,300

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
65
Dependency
Built with
TypeScript48%
Go46%
Updated today
TypeScript
71%
Other

highlight.io

Developer Tools · Analytics · Monitoring

9,367

Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.

View details
69
Repo Health
78
Technical
66
Dependency
Built with
TypeScript71%
Go16%
Updated yesterday
TypeScript
98%
MIT

GraphQL Hive

Developer Tools · Devops · Monitoring

485

Open-source GraphQL schema registry and observability platform with breaking change detection, federation support, and CI/CD integration for teams of any size.

View details
90
Repo Health
81
Technical
70
Dependency
Built with
TypeScript98%
Updated today

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