Make a 3D Image Carousel with React Slick

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024

Комментарии • 54

  • @skyenolimit6209
    @skyenolimit6209 2 года назад +1

    As a self taught dev, I thank you for the in-depth explanation. You have a new subscriber, thank you so much!

  • @lylerogers8694
    @lylerogers8694 3 года назад +7

    He maid three hours of annoying research through documentation look simple. And now it is, Yes!

  • @amingrateful7661
    @amingrateful7661 2 года назад

    EXACTLY what I was looking for 👍🏻👍🏻👍🏻 great video. Thanks

  • @hanzenpeter3917
    @hanzenpeter3917 3 года назад +1

    Thank you are a live saver! Best tutorial ❤️

  • @imaginechiu4371
    @imaginechiu4371 Год назад

    Thank you for the tutorial :)
    I'd like to recommend another React carousel to you, it's called "bear-react-carousel". You might want to give it a try.

  • @viniciusbittencourt2649
    @viniciusbittencourt2649 2 года назад

    Thank's man, very good tutorial, save a workproject mine

  • @mira-films1169
    @mira-films1169 3 года назад +1

    Thanks Chris, i have a little question, how can i edit the styles of the arrows based on the length of the Slider, i mean, if the slider is in the end desactivate the right arrow, again, thanks!

    • @ChrisDeSilva
      @ChrisDeSilva  3 года назад +2

      I'm not 100% sure how I'd implement it with this library, but I imagine that if you're using custom arrows then you can access the index of the current slide as well as the total length of your image array. If you can pass that info to your buttons through props. For the left arrow you could set the button to disabled when the index is 0. For the right arrow you could set disabled when the index equals the length of the array - 1.

  • @benedictpajarillaga2328
    @benedictpajarillaga2328 2 года назад

    hi, I get an error when I import slick css, I installed it tho

  • @MUandST
    @MUandST 3 года назад +1

    Thank you so much 💝

  • @maffseds
    @maffseds Год назад

    anyone know if there's a way with slick slider to make it so rather than images appearing out of nowhere, the left image animates to the right images place, 2nd (main) image minimises to the 1st images place, and 3rd image enlarges to the 2nd (main) images place?

    • @Papu-px5pc
      @Papu-px5pc 11 месяцев назад

      even i have same problem if u got any solution please share with me too

  • @julieta1790
    @julieta1790 2 года назад

    Thank you! This was very useful : D

  • @ganesan.r5430
    @ganesan.r5430 2 года назад

    thank you so much for sharing

  • @Coolgardt
    @Coolgardt Год назад

    Thank you!

  • @natamatos8547
    @natamatos8547 2 года назад

    Thank you for your help

  • @ranjmahmood2429
    @ranjmahmood2429 2 года назад

    Great tutorial, thanks

  • @Sameer.Trivedi
    @Sameer.Trivedi Год назад

    Thankyou so much man!

  • @moisessoto5061
    @moisessoto5061 3 года назад

    nice also using the cyberpunk theme

  • @manojkumar-qp8xu
    @manojkumar-qp8xu 3 года назад

    Wonderful... Is that slide works without the arrow buttons..
    Like, scrolling horizontally over the carrousal? With Having the same effect

    • @ChrisDeSilva
      @ChrisDeSilva  3 года назад +1

      You've got lots of options for customizing the slider. You can set arrows to false and play around with some of the other settings. Check out the API here: react-slick.neostack.com/docs/api

  • @TheAlmostTV
    @TheAlmostTV 3 года назад

    Hey, nice tutorial! Can you explain why the spread operator is used in ? I have a hard time grasping when it should be used

    • @ChrisDeSilva
      @ChrisDeSilva  3 года назад +3

      Thanks! The spread operator allows you to pass in the entire settings object as props to the slider component. Otherwise, you'd need to pass them all in individually so it'd be something like

  • @eeebeltran5445
    @eeebeltran5445 3 года назад

    Thank you! Eres el mejor!!!

  • @Peace8D
    @Peace8D 3 года назад +1

    Hey Chris, amazing tutorial bud, could we get another tutorial on how to make this responsive? like 2 images on medium width screens and 1 on smaller ones? Would be great to see that on the channel ✌

    • @ChrisDeSilva
      @ChrisDeSilva  3 года назад +1

      Check the channel in a week or two and I'll get something put together

    • @Peace8D
      @Peace8D 3 года назад

      @@ChrisDeSilva Thanks man, really appreciate your prompt response. Would love to be a part of your findings. We can customise the number of slides by using a responsive property in the settings, eg.
      responsive: [
      {
      breakpoint: 1024,
      settings: {
      slidesToShow: 3,
      slidesToScroll: 3,
      infinite: true,
      dots: true
      }
      },
      {
      breakpoint: 600,
      settings: {
      slidesToShow: 2,
      slidesToScroll: 2,
      initialSlide: 2
      }
      },
      {
      breakpoint: 480,
      settings: {
      slidesToShow: 1,
      slidesToScroll: 1
      }
      }
      ]
      Lots of love and appreciation for you 😃

    • @ChrisDeSilva
      @ChrisDeSilva  3 года назад

      @@Peace8D Ended up doing it a little differently, but here's the link to the follow-up video: ruclips.net/video/a9YxAlJMgAI/видео.html

  • @Mikef05316338
    @Mikef05316338 2 года назад

    Awesome vid. Quick question, you know the {onClick} prop that goes into each arrow component, does that run a function that is under the hood as part of the Slider component?

    • @ChrisDeSilva
      @ChrisDeSilva  2 года назад +1

      That's the idea, yeah. You spread in the settings object with your custom arrows with their click handlers. From there, the Slider component has access to them. If you really want to get into the weeds I'd recommend checking out the source code: github.com/akiran/react-slick/blob/master/src/slider.js

    • @Mikef05316338
      @Mikef05316338 2 года назад

      @@ChrisDeSilva oh awesome! Thanks so much for your reply! Seriously great video, you have helped me out a lot! 🤘🤘

  • @dylancam812
    @dylancam812 2 года назад

    This is a great video, but is there anyway to get it to work with onKeyDown using the right and left arrow on desktop or a swipe on mobile?

    • @ChrisDeSilva
      @ChrisDeSilva  2 года назад

      Check this section of the docs out for swiping: react-slick.neostack.com/docs/example/swipe-to-slide. As for the key down event, you can do the same thing as the onclick but check the e.key to see if it matches the arrow you're pressing: developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values

    • @dylancam812
      @dylancam812 2 года назад

      @@ChrisDeSilva Thanks so much!

  • @edubaba
    @edubaba 3 года назад

    Can the slides author play without clicking ?

    • @ChrisDeSilva
      @ChrisDeSilva  3 года назад +1

      You should be able to set autoplay to true. Here's a link to the docs: react-slick.neostack.com/docs/api

  • @pavanmyana5020
    @pavanmyana5020 2 года назад

    ​ @Chris DeSilva can u do it 5 images ... like the active slide is bigger and back slides in decreasing order of size

    • @ChrisDeSilva
      @ChrisDeSilva  2 года назад

      Definitely. You'll just want to play around a bit with the styles to make sure everything fits. You can also adjust the slidesToShow and slidesToScroll values.

  • @codigosimple1989
    @codigosimple1989 3 года назад

    are you sure we can use other icons? my antd arrows are not showing

    • @ChrisDeSilva
      @ChrisDeSilva  3 года назад

      If slidesToShow is greater than or equal to the total number of images in your array, the arrows won't show up

    • @codigosimple1989
      @codigosimple1989 3 года назад

      @@ChrisDeSilva thanks that was it haha, silly me XD

  • @GLBrand
    @GLBrand 2 года назад

    THANKS A LOT!!!!!!!

  • @bernardmariten2142
    @bernardmariten2142 3 года назад

    Weirdly the arrows did not style on my practice

    • @ChrisDeSilva
      @ChrisDeSilva  3 года назад

      Make sure the number of images in your array is greater than the number for slidesToShow, otherwise the arrows won't show up

  • @jaycrijaygandhi
    @jaycrijaygandhi 3 года назад

    one doubt what about making it responsive

    • @ChrisDeSilva
      @ChrisDeSilva  3 года назад

      You've got a couple of options depending on what exactly you want to do. You'll want to use media queries and then move things around as you see fit. You can make all three images smaller, reposition the arrows, leave the left and right images off the screen entirely and only show the center image as it slides in. Lots of different things you can do, but you're right, the code as it's written is optimized for desktop and would need to be adjusted based on your needs in order for it to look nice on smaller screens.

    • @jaycrijaygandhi
      @jaycrijaygandhi 3 года назад

      @@ChrisDeSilva I used one of those props variableWidth(boolean). I set it to true and it worked wonders

    • @ChrisDeSilva
      @ChrisDeSilva  3 года назад +1

      Awesome! Thanks for sharing that

    • @jaycrijaygandhi
      @jaycrijaygandhi 3 года назад

      @Ishaan Wadhwa (Intern) oh yess, you could just add a property variableWidth: true to the options

  • @codigosimple1989
    @codigosimple1989 3 года назад

    can we show 5 slides? "slidesToShow: 5"??

    • @ChrisDeSilva
      @ChrisDeSilva  2 года назад

      As long as you've got at least 5 images

  • @shaunakchandra737
    @shaunakchandra737 Год назад

    thnks a lot for this helpful video

  • @afiffirdaus1033
    @afiffirdaus1033 3 года назад

    Thank you!