| React.ComponentType<{|
data: T,
itemIdx: number,
isMeasuring: boolean,
|}>
| |
| A React component (or stateless functional component) that renders the item you would like displayed in the grid. This component is passed three props: the item's data, the item's index in the grid, and a flag indicating if Masonry is currently measuring the item.
| |
| | |
| An array of items to display that contains the information that comp needs to render.
| |
| | |
| The preferred/target item width. If 'flexible' is set, the item width will grow to fill column space, and shrink to fit if below min columns.
| |
| | |
| Item width will grow to fill column space and shrink to fit if below min columns.
| |
| | |
| The amount of vertical and horizontal space between each item, specified in pixels.
| |
| MasonryDefaultLayout | MasonryUniformRowLayout
| |
| MasonryUniformRowLayout will make it so that each row is as tall as the tallest item in that row.
| |
| false
| ((
?{|
from: number,
|},
) => void | boolean | { ... })
| |
| A callback which the grid calls when we need to load more items as the user scrolls. The callback should update the state of the items, and pass those in as props to this component. Note that scrollContainer must be specified.
| |
| | |
| Masonry internally caches item sizes/positions using a measurement store. If measurementStore is provided, Masonry will use it as its cache and will keep it updated with future measurements. This is often used to prevent re-measurement when users navigate away and back to a grid. Create a new measurement store with Masonry.createMeasurementStore() .
| |
| | |
| Minimum number of columns to display.
| |
| | |
| A function that returns a DOM node that Masonry uses for on-scroll event subscription. This DOM node is intended to be the most immediate ancestor of Masonry in the DOM that will have a scroll bar; in most cases this will be the window itself, although sometimes Masonry is used inside containers that have overflow: auto . scrollContainer is optional, although it is required for features such as virtualize and loadItems . This is required if the grid is expected to be scrollable.
| |
| | |
| If virtualize is enabled, Masonry will only render items that fit in the viewport, plus some buffer. virtualBoundsBottom allows customization of the buffer size below the viewport, specified in pixels.
| |
| | |
| If virtualize is enabled, Masonry will only render items that fit in the viewport, plus some buffer. virtualBoundsTop allows customization of the buffer size above the viewport, specified in pixels.
| |
| | |
| Specifies whether or not Masonry dynamically adds/removes content from the grid based on the user's viewport and scroll position. Note that scrollContainer must be specified when virtualization is used.
| |