rodleviton / vue-card-stack

Stackable, swipeable, tweakable Vue card component.
https://rodleviton.github.io/vue-card-stack/
MIT License
78 stars 13 forks source link

Feature: Adding a slot for a next and previous buttons #3

Closed amineyarman closed 3 years ago

amineyarman commented 3 years ago

Thanks for this amazing project. The result looks quite polished.

But I have a suggestion to add a bit more flexibility and ease of use on certain devices. Adding a slot for a next button, and one for a previous button would be quite handy. It would make it a quite sophisticated carousel.

rodleviton commented 3 years ago

@Aminerman seems like a reasonably simple feature to implement and I agree that it would make the library more flexible. I should be able to work on it this week.

amineyarman commented 3 years ago

Amazing :) I'll be looking forward to that!

rodleviton commented 3 years ago

@Aminerman I am proposing that this be the slot api for the navigation controls. It will give you access to methods to go forward and backwards through the stack as well as a property which will enable you to determine what index you are currently at. Providing just these props and not assuming any default controls gives the consumer of the library full control on how any controls are implemented. Let me know your thoughts. If happy I will finalise documentation and push out a new release.

Example usage:

https://github.com/rodleviton/vue-card-stack/pull/4/files#diff-ede2fa9fc34946ac9c55150e89a3d553da24e82307f8b24b51030059a4c3b5d3R12