-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(carousel): navigation dots #2478
base: main
Are you sure you want to change the base?
Conversation
@huri3l is attempting to deploy a commit to the shadcn-pro Team on Vercel. A member of the Team first needs to authorize it. |
Seems pretty solid and useful. I would love to see this merged. |
please approve this |
Please approve this |
bruh, my big head homie is a total genius, you just gotta approve it. please. |
Pagination with dots is a highly beneficial feature, especially when dealing with a substantial number of rendered cards. This implementation significantly enhances the user experience, allowing users to navigate directly to a specific card without the need to scroll through them one by one. Great improvement! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approve your efforts.
Functionality works fine with 5 or less items but when it comes to having more than 5 items, then it breaks (API is giving incorrect value, you did good).
Also, setting primary background color is not a good idea as it is mostly changed as per user preference, instead you should try using muted-foreground like:
isCurrent(index) ? "bg-muted-foreground" : "bg-muted-foreground/40"
If you continue the issue, I have a suggestion for you to add dotsSize and dotsGap for better customisation.
Screen.Recording.2024-01-19.at.8.33.21.PM.mov
That problem is being solved but I got another issue: Solution for previous issue:
New issues found: Screen.Recording.2024-01-19.at.9.17.56.PM.mov |
I intend to continue the issue until it is merged and available for everyone. Thanks for the feedback, I'll do my best to fix the issues you found. I loved the suggestion for |
About the issue that the carousel has an extra step, I have opened an issue into embla-carousel repository. In the moment, I am not sure if the Carousel component from As far as I have debugged, in the specific case of 6 contents and 3 visible per slide, And if you look closely, you can see the carousel actually moving in the last step. So this solution will be handled through the issue linked above. If it is something that The goal is to see if |
@soham2k06 the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job for adding gap and size prop in dots to add better customisation.
I hope you quickly get solution for snap value in carousel.
Good luck.
7e0c54b
to
ff45735
Compare
@soham2k06 a bug fix for this has already been released in |
@soham2k06 but we still need to bump the packages in this PR and someone also has to approve it I think: Of course, if everything else has been solved in that pull request. |
Hey @huri3l, After working on my own implementation of dot pagination for the Carousel component, I came across your PR and found some great ideas that complemented my approach. I've since refined my version to include a streamlined pagination logic within the useCarousel hook and flexible dot placement for different orientations. Feel free to check it out #3463 Perhaps there's an opportunity to combine our efforts. |
Hi! I will check it out right now. |
As I was using
Carousel
component, I needed to implement Dots Pagination in my project. They are pretty common in many Carousel/Slider libraries, such as slick, Keen-Slider, Swiper and etc.This pull request adds a
CarouselDots
component to improve the currentCarousel
.