Skip to content

How to make custom layout using rowConstraints? #174

Answered by igordanchenko
AndrasE asked this question in Q&A
Discussion options

You must be logged in to vote

Hi there! Please see if the following settings provide the layout you are looking for.

<PhotoAlbum
  layout="rows"
  photos={photos}
  componentsProps={{
    containerProps: { style: { maxWidth: 1200, marginInline: 'auto' } },
  }}
  rowConstraints={(containerWidth) => ({
    maxPhotos: containerWidth > 600 ? 4 : 2,
  })}
/>

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@AndrasE
Comment options

Answer selected by AndrasE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants