Installation & Usage
You can install React Layout Masonry using npm, pnpm or yarn:
Usage
Fixed Columns Layout
Here’s an example of how to use React Layout Masonry with a fixed number of columns in your React application:
Responsive Columns Layout
Here’s an example of how to use React Layout Masonry with responsive columns in your React application:
Column Props
The columnProps
prop allows you to apply additional props to the container of each column. Here’s an example:
Props
columns
(number or object, required): The number of columns in the masonry layout, or an object with breakpoints and corresponding column counts.gap
(number, optional): The spacing between columns and rows in pixels. Defaults to 0.columnProps
(object, optional): Additional props to be applied to each column, such as className for styling.