react-virtualized-auto-sizer

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

Library
npm
v2.0.4
669 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
64 /100 Good
Development Activity 68
Maintenance 44
Community 56
Maturity 60
Momentum 28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
75 /100 Good
Architecture 74
Code Quality 78
Innovation 58
Learning Curve 88

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
73%
Apache 2.0

Jitsi Meet

Collaboration · Team Chat · Video Conferencing

30,130

Open-source, end-to-end encrypted video conferencing you can self-host or embed into any web or mobile app.

View details
96
Repo Health
85
Technical
67
Dependency
Built with
TypeScript 73%
Lua 11%
JavaScript 10%
Updated 1 weeks ago
TypeScript
39%
Apache 2.0

Label Studio

AI Development · Data Engineering

28,540

Label Studio is an open-source, multi-type data labeling platform that lets teams annotate images, text, audio, video, and time series data with a configurable XML-based UI and export annotations in formats ready for any ML framework.

View details
93
Repo Health
87
Technical
64
Dependency
Built with
TypeScript 39%
JavaScript 27%
Python 25%
Updated 1 weeks ago
TypeScript
51%
Other

Mattermost

Collaboration · Devops · Team Chat

39,418

Open core, self-hosted team collaboration with chat, AI agents, voice calling, and deep DevOps integrations — all under your control.

View details
96
Repo Health
87
Technical
65
Dependency
Built with
TypeScript 51%
Go 40%
Updated 6 days ago
TypeScript
91%
AGPL 3.0

OpenPanel

Analytics

7,187

Open-source Mixpanel alternative with session replay, MCP integration, and privacy-first product analytics you fully control.

View details
83
Repo Health
74
Technical
64
Dependency
Built with
TypeScript 91%
Updated 1 weeks ago
TypeScript
98%
Other

Outline

Collaboration · Knowledge Management

41,045

A fast, real-time collaborative knowledge base for growing teams built on React, Node.js, and ProseMirror.

View details
91
Repo Health
87
Technical
68
Dependency
Built with
TypeScript 98%
Updated 6 days ago
TypeScript
90%
MIT

Plasmic

CMS · Design Tools · Low Code Platforms

7,125

The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.

View details
81
Repo Health
78
Technical
64
Dependency
Built with
TypeScript 90%
Updated 1 weeks ago
Python
55%
Other

PostHog

Ab Testing Experimentation · Analytics · Developer Tools

40,397

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
65
Dependency
Built with
Python 55%
TypeScript 36%
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