Slider packages
Hi everyone
Any package like https://keen-slider.io/ or others to create sliders and carousels?
Thanks π
Keen-Slider: Easily create sliders, carousels and much more.
Keen-Slider is a free library agnostic touch slider with native touch/swipe behavior and great performance. βοΈ No Dependencies βοΈ Typescript Support βοΈ Fully Responsive
27 Replies
GitHub
GitHub - davedbase/solid-slider: A carousel/slider implementation f...
A carousel/slider implementation for SolidJS. . Contribute to davedbase/solid-slider development by creating an account on GitHub.
It wraps KeenSlider π
www.embla-carousel.com
A lightweight carousel library with fluid motion and great swipe pr...
A lightweight carousel library with fluid motion and great swipe precision
Thank you @davedbase
Other question, and sorry, I'm trying to migrate a website I did in Nextjs with Sanity to Solid Start with Sanity, but in the Nextjs version I use aos to do animations on scroll to elements appear
Any solution to do that in Solid/ Solid start?
https://www.solid-ui.com/docs/components/
Has both and more. Itβs build with tailwind and is like shadcn for solid.
Has both carousel and slider and plenty more components which get copied to your code base so you totally own it.
solid-ui
Beautifully designed components built with Kobalte and Tailwind CSS.
Thanks @madani
Any tip for the AOS (animations on scroll)?
Hi everyone
@davedbase and @Madaxen86 any idea why I'm getting this error:
Cannot read properties of null (reading 'getComputedStyle')
I have no idea how itβs implemented so Iβm not going to be much help here. Is that from SolidUI? During SSR?
I copy the code from Solid UI yes
The error appears when I navigate between pages
This is the component that I'm using on the home page (where the error is appearing)
This is the usage
I only implement the dots to the carousel
The error is always when I change betwen pages, like:
- I'm in Home
- Goes to about page
- Switch again to Home page
- The error appears π¦
I put
ssr: false
on app.config
and dind't find the error again :/Yeah it sounds like the slider is trying to access the window object during SSR to calculate the dimensions. It needs to be guarded to prevent that.
@Stefan E-K any thoughts?
@Daniel Sousa @TutoDS it would be worth submitting a ticket on solid-ui.
Thank you
Already open a discussion on the emma repository
I donβt think it has anything to do with Embla though.
The only solution I found is disabling
ssr
π¦For now that makes sense. There should be a way to avoid using that function. Rendering a basic structure to the slider and then initializing it on the client. However Stefan would have to implement that
You could also load the component as clientOnly until it is fixed so you can keep SSR enabled.
https://docs.solidjs.com/solid-start/reference/client/client-only#clientonly
Ok I will try that, sorry for noob questions
@Madaxen86 using
clientOnly
can have any impact?
Already try it, on the subcomponent that uses the carousel and dind't work
Let me restart the project to see if changes anythingThe error keeps appearing after use
clientOnly
it looks like this might be more of an embla error than an SolidUI error.
Is the creator a member of this discord?
can you upload a minimal repro ? so we can have a closer look at the code? π
https://codesandbox.io/p/devbox/embla-carousel-kycpkw
I copy my code to this codesandbox
@Stefan E-K do you know any other carousel package that I can use in Solid to try if works?
I doubt they would be. Embla must be SSR safe, how are the other framework impl getting around this?
it's weird since the SolidUI docs have SSR set to true and everything works fine
but I'll have a look at the repro, hopefully we can find the issue π
I'm facing a strange behavior change between routes too, could the prerender?
Hi everyone
After try a few things I can't found anything that works π¦
Sometimes the error appears again, using the
clientOnly
less times than the normal input π¦Here's an implementation of embla carousel without any client only etc. - no errors or hydration issues:
https://stackblitz.com/edit/github-yivysl?file=src%2Fcomponents%2FCarousel.tsx
StackBlitz
Solid-start Basic Example - StackBlitz
Run official live example code for Solid-start Basic, created by Solidjs on StackBlitz
Thanks I will take a look
Madaxen, could be because fo the context?
I follow the code on Solid UI
Maybe I will try to refactor it, and make it simpler, I don't know
Thanks for your time π
Iβm going to be taking a closer look at this implementation and upgrading solid-slider. If you do simplify and improve Iβd love to have a look + give credit if I utilize it in my solution.
Also this is good learning for SolidUI
Solid-UI carousel is aslo working:
https://stackblitz.com/edit/github-yivysl?file=src%2Froutes%2Findex.tsx
StackBlitz
Solid-start Basic Example - StackBlitz
Run official live example code for Solid-start Basic, created by Solidjs on StackBlitz
Sorry guys to back with this
In my case I have implemented the dots to navigate, but when I navigate dragging to the next slide, the dots don't update
Any specific method to get the "currentIndex" when moving slides with dragging?