最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin0浏览0评论

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

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:

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 acplish what I'm looking for with react-swipeable-views or if there is a better library out there to acplish UIC as seen in the image?

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

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./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 acplish what I'm looking for with react-swipeable-views or if there is a better library out there to acplish UIC as seen in the image?

Share Improve this question edited Jul 19, 2018 at 6:43 halfer 20.3k19 gold badges109 silver badges202 bronze badges asked Jun 27, 2018 at 19:21 AnApprenticeAnApprentice 111k202 gold badges637 silver badges1k bronze badges 3
  • Did you finf something? Lookin this as well – Sergey Kudryashov Commented Aug 2, 2018 at 12:13
  • Also looking... – olisteadman Commented Feb 22, 2019 at 10:55
  • Have a look at the last example on this page from the react-spring library which is similar to what you are looking. I hope it helps you! – reymon359 Commented Jun 18, 2020 at 14:34
Add a ment  | 

3 Answers 3

Reset to default 3

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

I hope it helps you!

you can check the recent react-native-reanimated-carousel. here you will see multiple example you can check there demo

You can Use :

import { Card, CardWrapper } from "react-swipeable-cards"

Your Card and their elements should be in CardWrapper

<CardWrapper >
  <Card>

  </Card>
</CardWrapper >
发布评论

评论列表(0)

  1. 暂无评论