How To Create 3 Levels Of React Image Sliders - Beginner, Intermediate, Expert

  Рет қаралды 63,632

Web Dev Simplified

Web Dev Simplified

Күн бұрын

React Simplified Course: reactsimplified.com/?...
Image sliders and carousels are incredibly popular on the web but 99% of tutorials do them wrong. In this video I will show you three different ways to build an image slider from beginner to intermediate to expert. By the end of this video you will have an image slider that is better than any other image slider.
Also, I want to note I am not at all an accessibility expert. I am still quite junior when it comes to advanced accessibility features so if I missed something related to accessibility please let me know in the comments.
📚 Materials/References:
React Simplified Course: reactsimplified.com/?...
GitHub Code: github.com/WebDevSimplified/r...
CSS unset Property Video: • Do You Really Understa...
CSS unset Property Article: blog.webdevsimplified.com/202...
Skip Link Video: • Why Does Nearly Every ...
🌎 Find Me Here:
My Blog: blog.webdevsimplified.com
My Courses: courses.webdevsimplified.com
Patreon: / webdevsimplified
Twitter: / devsimplified
Discord: / discord
GitHub: github.com/WebDevSimplified
CodePen: codepen.io/WebDevSimplified
⏱️ Timestamps:
00:00 - Introduction
01:02 - Image Slider #1
11:52 - Image Slider #2
21:51 - Image Slider #3
#ImageSlider #WDS #ReactJS

Пікірлер: 106
@nove1398
@nove1398 7 ай бұрын
I really appreciate videos like these, where we get to see it all from start to end. Personally, I believe building out small projects like this helps to teach many small important bits.
@oscarh4066
@oscarh4066 7 ай бұрын
Great content, Kyle! Appreciate seeing the progress of the different versions of the slider.
@MattHanes
@MattHanes 7 ай бұрын
This was excellent, I love how you included all of those accessibility features that are so often overlooked. I expected the aria-labels, but adding the content skipping was something I never thought about. A cool follow-up vid might be to show how to make the slider swipeable for touch users like on a phone or tablet.
@slinco65
@slinco65 7 ай бұрын
Kudos for adding the accessibility details. So many tutorials leave off this very important part 👍
@diogenespasqualoto1675
@diogenespasqualoto1675 Ай бұрын
O nome do canal é WDS
@pedromenezes4013
@pedromenezes4013 7 ай бұрын
It's really cool to see accessibility on a tutorial. Also really liked the accessibility button tip inside dev tools!
@user-qj4rr1rm8i
@user-qj4rr1rm8i 7 ай бұрын
Everything I need to know about the accessibility part. Thank you Kyle.
@xav_624
@xav_624 7 ай бұрын
I really enjoyed the accessibility part. Very instructive content. 👍
@developerpranav
@developerpranav 6 ай бұрын
The version 3 with accessibility touches is super helpful, I'd never have known anything beyond the version 2 until now. Thanks for the great tutorial, wanna get your Next.js course soon ❤
@leosombra8708
@leosombra8708 4 ай бұрын
thank you. I'm from Argentina, and it's the first time I see your content, you're great. I recommended your channel to my friends
@jhontriboyke5534
@jhontriboyke5534 3 ай бұрын
The accessibility part is really amazing! thank you Kyle
@danielwinkler1910
@danielwinkler1910 7 ай бұрын
insanely good tutorial, well done :D
@parmjeetmishra2
@parmjeetmishra2 7 ай бұрын
Well this was very complicated for me from the start. but finally i understand completely. Thanks
@Veedsify
@Veedsify 7 ай бұрын
Everytime i think i know css, kyle comes up with features that makes me feel like a beginner again
@brainftv
@brainftv 6 ай бұрын
Thanks Kyle! The whole idea of rendering all the images to animate them more easily, never occurred to me! Elegant. Challenge to you and the rest of us: how would you make the images "drag" with the mouse, or in the case of mobile website drag with a touch event?
@goodtimeswerehad
@goodtimeswerehad 2 ай бұрын
Another brilliant video Kyle, thank you!
@rico5146
@rico5146 7 ай бұрын
Great! One thing i just want to mention is that i think it is fine to only control z-index property of skip link button in this video. It seems that the button doesn't need to be squashed at all by setting each properties width and height by 1.
@rdalert3
@rdalert3 7 ай бұрын
you have no idea how frustrated I am with ready to use sliders libraries, I always wanted to create my own component just never had the time. thank you very much 😍
@re.liable
@re.liable 7 ай бұрын
Nice. I expect to be coming back to this video a lot. Please do not take it down 🙏🏼 And many thanks for sharing I suppose I'll figure out next how to lazily load the images
@theisoj
@theisoj 7 ай бұрын
Thanks Kyle as always! 👍
@Trazynn
@Trazynn 7 ай бұрын
Teaching React this way is way more useful than all the abstract stuff.
@benjaminfourgeaud7707
@benjaminfourgeaud7707 6 ай бұрын
As always, excellent tutorial ! The acessibility is a nice add-on feature no one thinks about. But the things that I am missing, is the scroll capability, to have that Slider work on mobile ... Hope you will cover that in a follow-up video ;)
@jamesgriesedieck5116
@jamesgriesedieck5116 5 ай бұрын
thanks for the informative video! I would love to see an auto scroll feature as well!!
@bobdpa
@bobdpa 6 ай бұрын
Lots of great info here. Thanks! 💯
@user-vu9dl3vn7l
@user-vu9dl3vn7l Ай бұрын
Thank you so much for this helpful tutorial!
@jasongrant2366
@jasongrant2366 2 ай бұрын
my man never disappoints
@yaroslavoz
@yaroslavoz 7 ай бұрын
Thanks, man👏
@user-pd2ic5pd3z
@user-pd2ic5pd3z 7 ай бұрын
Nice. I really appreciated how clear and concise your instructions were. However, I was wondering if you could provide some guidance on how to make the slider slide infinitely instead of going back to the first slide.
@shahzadasultan2456
@shahzadasultan2456 7 ай бұрын
Your content is what driving my career , Thank you Man😇
@Mauro0
@Mauro0 7 ай бұрын
Watch the video first maybe ?
@solidsnake1120
@solidsnake1120 7 ай бұрын
I would LOVE a Firebase Realtime Database tutorial with that React Firebase Auth video you did!
@xphstos_
@xphstos_ 7 ай бұрын
Images are inline objects and as such they align vertically with text baseline by default. In typefaces we have ascenders, baseline and descenders. Since by default the image aligns in baseline it leaves a small gap in its box model. You can either set the image as a block element and break that connection with type or set the vertical-align rule to middle.
@MirkoVukusic
@MirkoVukusic 7 ай бұрын
I think it's really necessary to add lazy loading of images and possibly also preloading the next one + blurred image placeholder while loading.
@Evil_E_ye
@Evil_E_ye 7 ай бұрын
Just use Image tag in next js😂
@MirkoVukusic
@MirkoVukusic 7 ай бұрын
​@@Evil_E_yeyes, it's one way of solving some of the issues mentioned, but not all. I.e. preloading next image (so swyping does not always end up with a loading indicator) needs to be programmed
@Evil_E_ye
@Evil_E_ye 6 ай бұрын
@@MirkoVukusic you are correct ✅ here.
@johncerpa3782
@johncerpa3782 7 ай бұрын
Excellent video
@anand_dudi
@anand_dudi 7 ай бұрын
Thanks for this masterpiece nd i have a suggestion if you could make videos on every react library functionality as SwiperJS provides same slider so it will help us to understand react in depth 😊 Thanks again
@atanu_200
@atanu_200 7 ай бұрын
guorgous 😍, I haven't added this much accessibility features for my projects, but now I will add all this and grateful to you kyle for this. it's great to have this kind of content free on KZbin. Thank you Kyle....
@aqibmalik6313
@aqibmalik6313 7 ай бұрын
i admire ur content and wait restlessly for ur next video Love from kashmir, India Aqib Malil
@sagarchilivery6112
@sagarchilivery6112 7 ай бұрын
Love from India ❤
@Matt23488
@Matt23488 7 ай бұрын
CSS needs a style property for making something hidden except from screen readers. It's kinda crazy you have to remember to do all of those things to make sure it behaves that way.
@jacobrichard2342
@jacobrichard2342 22 күн бұрын
You are the best !!!
@MrJacquers
@MrJacquers 7 ай бұрын
Very nice. How would it handle 100 images though? Guessing it would render far too many buttons :)
@imnikki00
@imnikki00 12 күн бұрын
Thanks kyle❤
@Di-yes
@Di-yes 7 ай бұрын
30:00 Oh, man, please, can you tell me does aria label really works for section? Cause I really searched a lot, but only found that you can use it on and interactive elements only. Will be really grateful for answer. Thanks
@jazzdestructor
@jazzdestructor 7 ай бұрын
Final Somebody with a proper accessibility video, i had to struggle so much to get this information previously (literally sat with react mui and kept checking why they used those labels there), if possible could you do video in depth about accessibility? The various other labels used. also in mui tab indexing when opening a modal takes you to modal fields, instead of the entire page behind i think they might be using content skip to go to the modal div, incase its something else do reply to this comment so that i could learn some new stuff. cheers🍻🍻👍👍
@GabrielSoldani
@GabrielSoldani 7 ай бұрын
Nice video. One thing that is always missing though is when you have images with different aspect ratios. It’s surprisingly finicky to constrain the gallery to the viewport dimensions while respecting the image’s aspect ratio, not running into layout shifts while the image is loading, and adding padding and controls around the image instead of on top. Recently I wrote one and I still haven’t landed on a solution that plays nice with server rendering and renders correctly in slightly outdated browsers. It’s no wonder you can still find companies selling lightbox components with an expensive commercial license.
@WebDevSimplified
@WebDevSimplified 7 ай бұрын
This slider will deal with images that are not the same aspect ratio. If you wanted to use images that are drastically different (such as 9:16 and 16:9) then you would probably want to change how the CSS object fit is instead of using cover.
@DioArsya
@DioArsya 7 ай бұрын
amazing! :)
@aakashsrivastava5557
@aakashsrivastava5557 2 күн бұрын
Great content
@cogitativeCoder
@cogitativeCoder 7 ай бұрын
can you make a video on logging. like winston, ELK, EFK and frameworks please
@w1nd251
@w1nd251 7 ай бұрын
How do You format all the code in one click? What do You use?
@gliderguld
@gliderguld 7 ай бұрын
Great. But shouldn't left and right arrow trigger slide (when focus is within this group)?
@Wilespro1
@Wilespro1 3 ай бұрын
You should make a similar video but with an infinite carousel
@mostafazieada3765
@mostafazieada3765 3 ай бұрын
Really 👍👍👍
@punch3n3ergy37
@punch3n3ergy37 7 ай бұрын
What about Sliders that contain images with different sizes? How would you handle that? Maybe you can do a video about that :)
@rico5146
@rico5146 7 ай бұрын
We can handle that problem by setting a property object-fit as cover on image. But the image aria outside the container boundary will be cliped.
@muhsin8604
@muhsin8604 7 ай бұрын
Nice
@justsample9185
@justsample9185 7 ай бұрын
Personally, I find it confusing why you set translate on each image. IMHO, a better approach is to set the translate on single div wrapper around the images
@mecozir
@mecozir 7 ай бұрын
test caller slow source validation with is element for dynamics passing should auto lock
@sahilverma_dev
@sahilverma_dev 7 ай бұрын
and now I am waiting for advanced slider. 😎😎
@beinyourguard
@beinyourguard 7 ай бұрын
it's already advanced enough. less is more.
@w1nd251
@w1nd251 7 ай бұрын
it's not optimized like at all, try using 20 images, lagging.@@beinyourguard and i'm using 4k images, so it's really laggy
@beinyourguard
@beinyourguard 7 ай бұрын
Kyle, how did you open that little menu box and imported useState at 3:09? what's the keyboard shortcut?
@MarvMarv397
@MarvMarv397 7 ай бұрын
I think „cmd“ + „.“ on mac. But when you hover over a not imported dependency, vscode should show you the shortcut in a popup.
@bouwensr
@bouwensr 7 ай бұрын
Why do I never see a slider that mix portrait and landscape and allow to rotate
@mecozir
@mecozir 7 ай бұрын
log in string allow app and load function decompiler item
@magnuserikkeenrobot1117
@magnuserikkeenrobot1117 6 ай бұрын
How good is Image slideres like this for mobile @Web Dev Simplified?
@ThugLifeModafocah
@ThugLifeModafocah 7 ай бұрын
Thank you for the content. It would be awesome if you create content about material design 3 image slider (carousel). It has some very beautiful properties and behaviors. It would be cool to see it implemented with tailwind and react. Anyways, thanks.
@mecozir
@mecozir 7 ай бұрын
overried template async tool view is context original error and platform code plugin
@GreenLikeGrass
@GreenLikeGrass 7 ай бұрын
should the dots really be aria-hidden, since they are interact-able?
@WebDevSimplified
@WebDevSimplified 7 ай бұрын
The buttons are the interactable thing (not the actual dot icons) which is why I hid the dots, but not the buttons.
@wkmgaming6097
@wkmgaming6097 Ай бұрын
I want to fixed the dots number just like airbnb card slider means if i have 20 images i want to show only 5 dots and when the slide move the current dot is show how to do could not find any good solution?
@jasongrant2366
@jasongrant2366 2 ай бұрын
Ok so I wanted to implement this to my website, but i encountered a small but important issue... my images are stored in AWS, and you know the drill. When the a button of next or previous image is pressed, it takes too long to make a change, I don't want to optimize them as this is where only one will load at a time and will allow the user to view the image at it's finest, but what i do ant to do is show a spinner or something while the other image is requested. I tried const [loading, setLoading] = useState(true), but it's just not exactly what I need. If anyone has a solution, please let me know. Thank you!
@rickpatinor
@rickpatinor 7 ай бұрын
Is a great video! But, It will be nice to see how you set up the project in VSC. Everything is already created when you start the video. So I can't even begin to follow you...
@mecozir
@mecozir 7 ай бұрын
origanal task file width drag push
@mecozir
@mecozir 7 ай бұрын
signals element process default change export before statement exit
@mecozir
@mecozir 7 ай бұрын
leaks tool entity does around
@RishiRajxtrim
@RishiRajxtrim 7 ай бұрын
👍💯
@CodingSumo
@CodingSumo 3 ай бұрын
can anyone help me how to change image when user try to swipe on phone
@AyoubRABIYAE
@AyoubRABIYAE 7 ай бұрын
❤❤❤
@EvertJunior
@EvertJunior 7 ай бұрын
unfortunately this doesn't cover touchscreen users, it's not trivial to make a responsive slider specially if you need controls and track index, that's why I always use Swiper library but I wish this was browser native
@MirkoVukusic
@MirkoVukusic 7 ай бұрын
What I do is use scroll on images container div, instead of transition like in this video. Then you can do snapping and smooth-scroll with a few css lines. For touch screens, css touch-action is very simple and it works like that on mobile without any additional JS code.
@CWhitmer22015
@CWhitmer22015 7 ай бұрын
Amen, that is what I do now as well. All the scrolling is built in and most stuff is handled by the browser. I have stopped coding and using slider for this approach. Much easier for the user as well.
@amansaxena4827
@amansaxena4827 7 ай бұрын
👍
@johnmishell234
@johnmishell234 7 ай бұрын
I don't get how in 2023, you still have to code up an image slider yourself. Why is there no standard html element for ui elements like this? It just takes way too long to update html standards.
@curcodes
@curcodes 7 ай бұрын
U don't, they are a lot of libraries for that. But knowing how to build it for yourself gives you more understanding
@faizanahmed9304
@faizanahmed9304 7 ай бұрын
This proves how deep understanding you know about your tech. Knowing from ground level is the thing that separates a great developer from the average ones who just copy pastes the library code.
@josephmonyoro5129
@josephmonyoro5129 7 ай бұрын
Cause it’s fun
@johnmishell234
@johnmishell234 7 ай бұрын
Yes there are libs, but it's just ridiculous that there isn't say an html element in which you can nest . No standards, everyone codes up their own crappy versions and that's for nearly every ui element
@mantas9827
@mantas9827 7 ай бұрын
I thought the same, on the same note, how are we just now getting popovers?
@kokojolo
@kokojolo 20 күн бұрын
😘😘
@adenugbamicheal2140
@adenugbamicheal2140 7 ай бұрын
Pls simplify real world project
@fullstackprojects5615
@fullstackprojects5615 Ай бұрын
idea copied from monsterlessons
How To Load Images Like A Pro
15:48
Web Dev Simplified
Рет қаралды 349 М.
ШЕЛБИЛАР | bayGUYS
24:45
bayGUYS
Рет қаралды 504 М.
Этого От Него Никто Не Ожидал 😂
00:19
Глеб Рандалайнен
Рет қаралды 10 МЛН
The Web Developer Job Market Is Broken
0:44
Web Dev Simplified
Рет қаралды 128 М.
Awesome Dark Carousel Slider in HTML & CSS | Carousel for Card Slider or Image Slider
14:47
Mathe. | Creative Coding Camp
Рет қаралды 49 М.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 442 М.
Has Generative AI Already Peaked? - Computerphile
12:48
Computerphile
Рет қаралды 295 М.
NEW React 19 Changes Are Amazing!
8:42
Web Dev Simplified
Рет қаралды 163 М.
How This Test Saved Kent’s Site
7:04
Web Dev Simplified
Рет қаралды 29 М.
React Image Slider
8:56
WebDev Basics
Рет қаралды 4,1 М.
How To Actually Get Hired In 2024
10:43
Web Dev Simplified
Рет қаралды 185 М.