Masonry

Demo

space man

0

mars along

4

night

8

space cat

1

cube

5

man with ballon

9

imac

2

hire car

6

colorful space man

10

mars

3

mario

7

cube 3d

11

Props

PropTypeDescription
childrenReact.ReactNode[] (optional)The elements to be displayed in the masonry layout.
breakpointCols{ [key: number]: number; }Configuration for the number of columns based on viewport width.
classNames{ masonry?: string; column?: string } (optional)Custom class names for the masonry grid and its columns.

Breakpoint Columns Object

This prop allows for defining the number of columns at specific viewport widths. It accepts either a single number for a fixed number of columns or an object with keys as viewport widths and values as the number of columns.

  • default: Default number of columns.
  • Breakpoints (e.g., 1100, 700, 500): Number of columns for specific viewport widths.

Styles

This component allows for custom styles via the classNames prop:

  • masonry: CSS class for styling the overall Masonry grid.
  • column: CSS class for styling individual columns within the Masonry grid.