Gathering detailed insights and metrics for react-virtualized-auto-sizer
Gathering detailed insights and metrics for react-virtualized-auto-sizer
Gathering detailed insights and metrics for react-virtualized-auto-sizer
Gathering detailed insights and metrics for react-virtualized-auto-sizer
@types/react-virtualized-auto-sizer
TypeScript definitions for react-virtualized-auto-sizer
lp-react-virtualized-auto-sizer-react-18
Standalone version of the AutoSizer component from react-virtualized
react-virtualized-auto-sizer-pro
Standalone version of the AutoSizer component from react-virtualized
@brave/react-virtualized-auto-sizer
Standalone version of the AutoSizer component from react-virtualized
Standalone version of the AutoSizer component from react-virtualized
npm install react-virtualized-auto-sizer
Typescript
Module System
Node Version
NPM Version
94.1
Supply Chain
94.4
Quality
82.9
Maintenance
100
Vulnerability
100
License
TypeScript (98.57%)
JavaScript (1.43%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
168,606,506
Last Day
213,806
Last Week
213,806
Last Month
3,378,956
Last Year
49,756,493
625 Stars
109 Commits
84 Forks
5 Watching
1 Branches
16 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.25
Package Id
react-virtualized-auto-sizer@1.0.25
Unpacked Size
44.05 kB
Size
9.34 kB
File Count
16
NPM Version
9.6.6
Node Version
20.2.0
Publised On
17 Dec 2024
Cumulative downloads
Total Downloads
Last day
0%
213,806
Compared to previous day
Last week
-69.3%
213,806
Compared to previous week
Last month
-6.6%
3,378,956
Compared to previous month
Last year
11.2%
49,756,493
Compared to previous year
16
Standalone version of the AutoSizer
component from react-virtualized
.
1npm install --save react-virtualized-auto-sizer
Property | Type | Required? | Description |
---|---|---|---|
children | Function | ✓ | Function responsible for rendering children. This function should implement the following signature: ({ height?: number | undefined, width?: number | undefined }) => PropTypes.element |
className | String | Optional custom CSS class name to attach to root AutoSizer element. This is an advanced property and is not typically necessary. | |
defaultHeight | Number | Height passed to child for initial render; useful for server-side rendering. This value will be overridden with an accurate height after mounting. | |
defaultWidth | Number | Width passed to child for initial render; useful for server-side rendering. This value will be overridden with an accurate width after mounting. | |
disableHeight | Boolean | Fixed height ; if specified, the child's height property will not be managed | |
disableWidth | Boolean | Fixed width ; if specified, the child's width property will not be managed | |
doNotBailOutOnEmptyChildren | boolean | Optional propr that can override default behavior of not rendering children when either width or height are 0 | |
nonce | String | Nonce of the inlined stylesheets for Content Security Policy | |
onResize | Function | Callback to be invoked on-resize; it is passed the following named parameters: ({ height: number, width: number }) . | |
style | Object | Optional custom inline style to attach to root AutoSizer element. This is an advanced property and is not typically necessary. | |
tagName | string | Optional HTML tag name for root element; defaults to "div" |
Some components (like those found in react-window
or react-virtualized
) require numeric width and height parameters. The AutoSizer
component can be useful if you want to pass percentage based dimensions.
1import AutoSizer from "react-virtualized-auto-sizer"; 2 3// UI 4<AutoSizer> 5 {({ height, width }) => { 6 // Use these actual sizes to calculate your percentage based sizes 7 }} 8</AutoSizer>;
Flex containers don't prevent their children from growing and AutoSizer
greedily grows to fill as much space as possible. Combining the two can be problematic. The simple way to fix this is to nest AutoSizer
inside of a block
element (like a <div>
) rather than putting it as a direct child of the flex container, like so:
1<div style={{ display: 'flex' }}> 2 <!-- Other children... --> 3 <div style={{ flex: '1 1 auto' }}> 4 <AutoSizer> 5 {({ height, width }) => ( 6 <Component 7 width={width} 8 height={height} 9 {...props} 10 /> 11 )} 12 </AutoSizer> 13 </div> 14</div>
AutoSizer
passing a height of 0?AutoSizer
expands to fill its parent but it will not stretch the parent. This is done to prevent problems with flexbox layouts. If AutoSizer
is reporting a height (or width) of 0- then it's likely that the parent element (or one of its parents) has a height of 0.
The solution to this problem is often to add height: 100%
or flex: 1
to the parent. One easy way to test this is to add a style property (eg background-color: red;
) to the parent to visually confirm that it is the expected size.
AutoSizer
to manage only width or height (not both)?You can use AutoSizer
to control only one dimension of its child component using the disableHeight
or disableWidth
attributes. For example, a fixed-height component that should grow to fill the available width can be created like so:
1<AutoSizer disableHeight> 2 {({width}) => <Component height={200} width={width} {...props} />} 3</AutoSizer>
This package targets ECMAScript 2015 (ES6) and requires a build tool such as babel-loader that is capable of parsing the ES6 class
syntax.
The specification of Content Security Policy describes as the following:
This document defines Content Security Policy, a mechanism web applications can use to mitigate a broad class of content injection vulnerabilities, such as cross-site scripting (XSS).
To apply Content Security Policy, pass a nonce
to AutoSizer
and add a matching nonce-source
to the Content-Security-Policy
field in HTTP header.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3
Reason
Found 8/21 approved changesets -- score normalized to 3
Reason
8 existing vulnerabilities detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More