Masonry
A masonry grid whose tiles spring into place as they scroll into view, zoom on hover, reorder by drag and open in a lightbox.
pixikit.com/docs/components/masonry
Customize
Columns
Column width240px
Gap12px
Radius12px
Animate from
Stagger0.05s
Duration0.60s
Bounce0.15
Blur to focus
Reveal on scroll
Hover effect
Focus on hover
Captions
Parallax0.00
Lightbox
Draggable
Props
21| Name | Type | Default | Description |
|---|---|---|---|
items | MasonryItem[] | DEFAULT_ITEMS | The tiles. Give width and height to lay out at once, otherwise the image is measured; span makes a tile cover more columns. |
columns | "auto" | number | "auto" | The column count. Auto fits as many columns of columnWidth as the container allows. |
columnWidth | number | 240 | The target column width for auto columns, in pixels. |
gap | number | 12 | Space between tiles, in pixels. |
radius | number | 12 | Corner radius of the tiles, in pixels. |
animateFrom | "bottom" | "top" | "left" | "right" | "center" | "random" | "none" | "bottom" | Where tiles come from as they appear. |
stagger | number | 0.05 | Delay between tiles appearing, in seconds. |
duration | number | 0.6 | Length of the motion that moves tiles in and between places, in seconds. |
bounce | number | 0.15 | How much the tiles overshoot as they settle, from 0 to 0.9. |
blurToFocus | boolean | true | Tiles sharpen from a blur as they appear. |
revealOnScroll | boolean | true | Tiles appear as they scroll into view instead of all at once. |
hoverEffect | "zoom" | "lift" | "tilt" | "none" | "zoom" | Zoom the image, lift the tile, or tilt it toward the cursor. |
focusOnHover | boolean | false | Fades the other tiles while one is hovered. |
captions | "hover" | "always" | "none" | "hover" | When the title and description show over a tile. |
parallax | number | 0 | How far images drift inside their tiles as the page scrolls, from 0 to 1. |
lightbox | boolean | true | Clicking a tile opens it full size; arrow keys move between images and Escape closes. |
draggable | boolean | true | Drag tiles with a mouse to reorder them; the grid reflows around the tile as it moves. |
onItemClick | (item: MasonryItem, index: number, event: ReactMouseEvent) => void | None | Called when a tile is clicked. Call event.preventDefault() to skip the lightbox or link. |
onReorder | (items: MasonryItem[]) => void | None | Called with the new order after a drag. |
className | string | None | |
style | CSSProperties | None |