I'm trying to implement an e-commerce based app using React Native and need some pointers in regards to building a multi step ListView with multiple selection options. For example, a user wants to purchase a t-shirt. Once they click 'add to cart' I need the component to load several options i.e. shirt size, color etc. Is there a component like this?
-
Sounds like a very specific use case, so unlikely someone has made exactly what you are looking for. In any case, it's not clear from your question what the requirements are, so I would recommend adding a bit more detail (e.g. screen mockups) on what you are trying to achieve.jevakallio– jevakallio2017-08-30 22:39:12 +00:00Commented Aug 30, 2017 at 22:39
1 Answer
What you are probably looking for here is an accordion or collapsible view. There are a few out there now, including:
- https://github.com/naoufal/react-native-accordion
- https://github.com/oblador/react-native-collapsible
Perhaps these don't exactly meet your needs, but they are a good starting point.
If you take react-native-accordion as an example, you could have your initial product view and purchase button visible inside a view and designate the purchase button as the header component that, when pressed, will reveal the shirt size and colour pickers. That should do it.
More generally, whenever you need a component you can check here (there are other resources too):