Skip to content

Is it possible to implement a Filter? #101

Discussion options

You must be logged in to vote

Hi there!

First of all, thank you for your patronage, and if you enjoy using my libraries, please consider showing your support by giving them a star here on GitHub.

I don't believe it's currently possible to integrate react-isotope with react-photo-album since both libraries use their own unique layout rendering approaches.

Implementing tags and filters is pretty straightforward. You can add a tags prop to your photo objects and then filter them before passings the photos array to the PhotoAlbum.

const photos = allPhotos.filter((photo) => Boolean((photo.tags || []).find((tag) => tags.includes(tag))));

// ...

<PhotoAlbum 
  photos={photos} 
  // ...
/>

As to isotope-like animations, the…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Phoi-Hoa-Nguyen
Comment options

Answer selected by igordanchenko
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