Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build stackable cards in React with react-swipe-card?

I'm looking to build a UI with stackable cards, something like:

enter image description here

Where there are a dynamic number of cards being the currently active card, and as the top card goes away, cards below is displayed. Very similar to Tinder's swipe-able experience.

I need to build this UI Component in my React web-app (not native). I found this library which looks very popular:

https://github.com/oliviertassinari/react-swipeable-views

However this library does not appear to support stacking view, and showing all the views at an offset as seen below.

Does anyone know if it is possible to accomplish what I'm looking for with react-swipeable-views or if there is a better library out there to accomplish UIC as seen in the image?

like image 601
AnApprentice Avatar asked Oct 17 '22 16:10

AnApprentice


1 Answers

You could use the react-spring library to achieve this. Here is an example of that behavior implemented.

I hope it helps you!

like image 179
reymon359 Avatar answered Nov 01 '22 07:11

reymon359