Usage
import { AutoSizer } from 'nr1'
Examples
Props
childrenrequiredfunction
Children function that will be called every time the parent resizes.
It is called with an object containing width
and height
keys, and
must return the React element to be rendered.
classNamestring
Classname for custom styling.
onResizefunction
Callback invoked when the container resizes.
function (args: OnResizeArguments )
spacingTypeenum[]
Spacing property. Spacing is defined as a tuple of zero to four
values, which follow the same conventions as CSS properties like
margin
or padding
. To omit a value, use SPACING_TYPE.OMIT
.
<Array of<One ofAutoSizer.SPACING_TYPE.EXTRA_LARGE,AutoSizer.SPACING_TYPE.LARGE,AutoSizer.SPACING_TYPE.MEDIUM,AutoSizer.SPACING_TYPE.NONE,AutoSizer.SPACING_TYPE.OMIT,AutoSizer.SPACING_TYPE.SMALL,>
>
styleobject
Inline style for custom styling.
Type definitions
OnResizeArguments
{height: number, Height of the container
width: number, Width of the container
}