Collage, similarly to Masonry, creates a deterministic grid layout that can absolutely position and virtualize images.

also known as Photo Composition

Figma:

Web:

iOS:

Android:

A11y:

Props

Component props
Name
Type
Default
columns
Required
2 | 3 | 4
-

Number of columns (2 - 4). Note that Collage assumes at least 2 * columns images will be provided. If fewer images are provided, care will be needed to avoid TypeErrors. See Columns example for more details.

height
Required
number
-

Height of the collage.

renderImage
Required
({|
  width: number,
  height: number,
  index: number,
|}) => React.Node
-

Callback to render the collage images.

width
Required
number
-

Width of the collage.

cover
boolean
-

Whether or not the first image is a cover image. See Cover Image example for more details.

gutter
number
-

The amount of vertical and horizontal space between images. See Gutter example for more details.

layoutKey
number
-

Depending on the number of columns of the collage, there may be multiple layouts available. If there are N layouts available, (layoutKey % N) will determine which layout is used. See Layout Key example for more details.

Basic example

Accessibility

Variants

Different columns

2 - 4 columns

Gutter

Cover image

Different columns with cover image

2 - 4 columns with cover image

Layout key

You can pick a layout using the layout key (layout key is 0 by default). Depending on the number of columns of the collage, there may be multiple layouts available. If there are N layouts available, (layoutKey % N) will determine which layout is used.

Component quality checklist

Component quality checklist
Quality item
Status
Status description
Figma Library
Component is not currently available in Figma.
Responsive Web
Ready
Component is available in code for web and mobile web.
iOS
Component is not currently available in code for iOS.
Android
Component is not currently available in code for Android.