How to Scroll Horizontally in React JS - Styled With Tailwind CSS - Javascript

  Рет қаралды 51,382

Code Commerce

Code Commerce

2 жыл бұрын

In this video, I will show you how to scroll horizontally in React JS styled with Tailwind CSS. Horizontal scrolling has become quite popular with mobile viewing and companies such as Netflix , Hulu, & Prime so I decided to give one a try. You can easily switch the Tailwind out for plain CSS. No React methods were used, only javascript so you can use this in any javascript project. Thank you for watching.
ZeroTo Mastery:
- Master React JS Course - bit.ly/Learn-React-JS
- Complete Web Developer in 2023 - bit.ly/Complete-Web-Developer...
Coding Challenges!
bit.ly/Code-Challenges
Github Repo
github.com/fireclint/horizont...
Tailwind Scrollbar Hide Package
www.npmjs.com/package/tailwin...
🔥 Connect with me on IG 🔥
/ fireclint
☕ Support the channel ☕
www.buymeacoffee.com/clintbriley
🔥 My Coding Equipment 🔥
Logitech MX Wireless Keyboard - amzn.to/3xKPFiN
Logitech MX Master 2S Wireless Mouse - amzn.to/3O5WmRD
SAMSUNG 49-Inch Gaming Monitor - amzn.to/3mvUy8M
Shure MV7 USB Podcast Microphone - amzn.to/3O00nqG
Mic Boom Arm - amzn.to/3NHn6YU
Monitor Desk Light Bar - amzn.to/3xzKlyj

Пікірлер: 71
@JJ-ot3ps
@JJ-ot3ps Жыл бұрын
great video! been looking for this for a while!
@anshXR
@anshXR 2 жыл бұрын
Exactly what I've been looking for! Thanks man ❤
@codecommerce
@codecommerce 2 жыл бұрын
Thank you Ansh!
@Badnercalabrese
@Badnercalabrese 2 жыл бұрын
Loving the new branding ! Code commerce ftw. Really appreciate your content man.
@codecommerce
@codecommerce 2 жыл бұрын
Appreciate it! I was thinking of changing the name of the channel to my full name - not sure yet.
@amirnejat5215
@amirnejat5215 Жыл бұрын
Amazing and helpful ty😭
@rayusaki88
@rayusaki88 2 жыл бұрын
Very helpful! Thanks man 🙏🏻🙏🏻
@codecommerce
@codecommerce 2 жыл бұрын
Thanks man!
@mohanadoo
@mohanadoo 2 жыл бұрын
Thanks for sharing this was very useful and easy to implement and you explain the steps very well 👍
@codecommerce
@codecommerce 2 жыл бұрын
Glad it was helpful!
@mardiyaz4287
@mardiyaz4287 Жыл бұрын
Thanks for this explanation. Clear and precise. Made me also realize tailwind would be ugly and annoying to use in projects. Extensive lines of styling all over the place makes everything look chaotic
@gabrielvega415
@gabrielvega415 10 ай бұрын
lol i'm in love with tailwind.
@DevIsrael
@DevIsrael 3 ай бұрын
thanks man, kudos to you
@studyafa7159
@studyafa7159 8 ай бұрын
greately explaine brother......
@ittarek5870
@ittarek5870 9 ай бұрын
nice video. thank you
@raulbtmonteiro
@raulbtmonteiro 2 жыл бұрын
Very usefull! Thanks for sharing
@codecommerce
@codecommerce 2 жыл бұрын
Thank you dude!
@sushantw834
@sushantw834 Жыл бұрын
Thank you.
@rebazjabar7660
@rebazjabar7660 2 жыл бұрын
that is what i wanted thanks alot
@codecommerce
@codecommerce 2 жыл бұрын
Thank you sir!
@kingjoo8309
@kingjoo8309 2 жыл бұрын
brother it's helpful I hope for you success
@codecommerce
@codecommerce 2 жыл бұрын
Thank you so much!
@alexdin1565
@alexdin1565 4 ай бұрын
short easy at the point and perfect that what can i say about this video thanks
@fatimaiqra2169
@fatimaiqra2169 5 күн бұрын
thanks a lot!
@codecommerce
@codecommerce 3 күн бұрын
Welcome!
@muratti32
@muratti32 Жыл бұрын
thank you. very helpfull
@codecommerce
@codecommerce Жыл бұрын
Thank you 🙏
@mohamedyoussef8835
@mohamedyoussef8835 Жыл бұрын
Awesome video +++++++++++++++++ 😃
@soakedso334
@soakedso334 Жыл бұрын
I LIKE YOU CUZ YOU GOT THAT SOMETHING THAT I NEED IN MY LIFE SO GIVE IT TO ME!!!
@ParaViciosos
@ParaViciosos Жыл бұрын
muchas gracias ! me sirvio de mucho
@codecommerce
@codecommerce Жыл бұрын
Anytime sir!
@cristiannass3945
@cristiannass3945 8 ай бұрын
thank you for the tutorial video, How do we disable buttons when we are at the first element and last element on the screen?
@andersonsimeon4172
@andersonsimeon4172 Жыл бұрын
Thank you very much
@codecommerce
@codecommerce Жыл бұрын
Thank you Anderson
@Yukthiisuranga
@Yukthiisuranga Жыл бұрын
thank you
@codecommerce
@codecommerce Жыл бұрын
You're welcome!!
@andreasiano5953
@andreasiano5953 7 ай бұрын
What if i want to write something below the image? I noticed that if i add a h1 tag after the img tag the layout breaks.
@pinguk9130
@pinguk9130 2 жыл бұрын
I was looking for the same can we add videos instead of images ? Can please make a video on that how can we add videos in this slider?
@mka70701
@mka70701 7 ай бұрын
please tell me how to add infinity autoplay slide
@ngc918
@ngc918 Жыл бұрын
Hey there. I implemented this into my portfolio after watching your portfolio video. I love how it came out! However, for some reason my image gallery goes over my navbar when I scroll down. Any solution for that?
@codecommerce
@codecommerce Жыл бұрын
Awesome! Check the positioning & z-index in CSS :)
@sajjadhoviegar5950
@sajjadhoviegar5950 Жыл бұрын
Is this menu scroll-able with touch screens? I mean is it possible to swipe left and right in mobile devices without clicking the icon buttons?
@user-kv7qd2gd8f
@user-kv7qd2gd8f Жыл бұрын
Hi boss, I implemented the code but in my browser it showing uncaught runtime error cannot read properties of null (reading '''scrollLeft'') can you help
@Hoid1014
@Hoid1014 3 ай бұрын
God
@PraveenMaurya-no6nf
@PraveenMaurya-no6nf 3 ай бұрын
i want that. Thanks. Can we do the same with tailwind css in more easy way
@andreasiano5953
@andreasiano5953 7 ай бұрын
I tried to add a div that wrap the img tag but again the layout breaks.
@cezarylachut4428
@cezarylachut4428 Жыл бұрын
hi great channel ; - ) i have rect+vite-tailwind , but there is a problem with local img not showing up, even after import, when I import from http it works
@codecommerce
@codecommerce Жыл бұрын
Haven’t done much with Vite.
@giovannaramos3239
@giovannaramos3239 Жыл бұрын
can scrollLeft be modified ?
@mounis
@mounis 2 жыл бұрын
Isn't there any other way to achieve this, I mean without using a querySelector? Shouldn't we avoid using querySelector in React? Looks somewhat hacky to me. However, I still appreciate what you've done. Thanks
@codecommerce
@codecommerce 2 жыл бұрын
Mounis - you are correct, a bit hacky. Perhaps I’ll do a follow up video with useRef
@mounis
@mounis 2 жыл бұрын
@@codecommerce that'll be great
@notagant47
@notagant47 3 ай бұрын
I have followed all your code and it's still not working, is it because I use typescript and and Next js ? the javascript is not running smooth at all only jumping and jumping when I scroll.
@vasilemidrigan50
@vasilemidrigan50 Жыл бұрын
Can I do that without Tailwind?
@buivancong8967
@buivancong8967 9 ай бұрын
not reponsive ?
@RudraStorm34
@RudraStorm34 Жыл бұрын
How can we scroll on touching the items?
@codecommerce
@codecommerce Жыл бұрын
Like click and drag?
@RudraStorm34
@RudraStorm34 Жыл бұрын
@@codecommerce yeah
@safiullah7184
@safiullah7184 Жыл бұрын
Appreciate your efforts man Everything sounds good excpet getelementbyid. Dude you are manipulating the DOM directly which we should not do in React JS
@pinguk9130
@pinguk9130 2 жыл бұрын
Sir Can you please try this with videos??
@codecommerce
@codecommerce 2 жыл бұрын
Good idea pingu
@pinguk9130
@pinguk9130 2 жыл бұрын
@@codecommerce I have tried this with videos with tailwind css and it worked.😊
@pinguk9130
@pinguk9130 2 жыл бұрын
@@codecommerce sir one more thing can we connect multiple pages in reactjs. And also full website with frontend and backend
@ismailk7021
@ismailk7021 Жыл бұрын
so I used the scroll function exactly like you showed in the video, but its not working.. I am using nextjs with typescript, but here is the code: const slideLeft = () => { let slider: HTMLElement = document.getElementById('slider')! slider.scrollLeft = slider.scrollLeft - 500 } const slideRight = () => { let slider: HTMLElement = document.getElementById('slider')! slider.scrollLeft = slider.scrollLeft + 500 }
@daotieesn
@daotieesn Жыл бұрын
U ARE Fix this ? I have the same issue
@ismailk7021
@ismailk7021 Жыл бұрын
@@daotieesn Yeah you need to wrap a div around the div that has the slide function.
@snorfold
@snorfold Жыл бұрын
thats not realy optimised.. 2 function for that please only 1 is needed... and why getElementByid please use useRef with hooks
@kamaboko1
@kamaboko1 Жыл бұрын
Make your own tutorial and post it.
@usmanrangrez-cd7zj
@usmanrangrez-cd7zj 10 ай бұрын
const sliderRef = useRef(null); //use this is your element ref={sliderRef} const slideLeft = () => { sliderRef.current.scrollLeft -= 500; }; const slideRight = () => { sliderRef.current.scrollLeft += 500; };
@unboxinggadgets4105
@unboxinggadgets4105 2 жыл бұрын
Pls sir use bootstrap css, in india developer don't use tailwind css
@codecommerce
@codecommerce 2 жыл бұрын
Oh no I hate using bootstrap! haha. I'll try and use it a least once in a video :)
Build a React Image Slider with Tailwind CSS
18:29
Code Commerce
Рет қаралды 105 М.
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 64 МЛН
Final muy increíble 😱
00:46
Juan De Dios Pantoja 2
Рет қаралды 53 МЛН
БОЛЬШОЙ ПЕТУШОК #shorts
00:21
Паша Осадчий
Рет қаралды 9 МЛН
NERF WAR HEAVY: Drone Battle!
00:30
MacDannyGun
Рет қаралды 52 МЛН
Incredible scroll-based animations with CSS-only
32:23
Kevin Powell
Рет қаралды 381 М.
Hide Navigation on Page Scroll || Framer Motion useMotionValueEvent
5:49
How the PROS Use Tailwind
9:55
Frontend FYI
Рет қаралды 44 М.
Horizontal Scrolling Animation with React and Framer Motion
4:54
Tom Is Loading
Рет қаралды 53 М.
Dynamic horizontal scrolling based on the amount of content
7:55
Kevin Powell
Рет қаралды 30 М.
How to hide scrollbar with Tailwind css?
5:04
AyyazTech
Рет қаралды 11 М.
路飞被小孩吓到了#海贼王#路飞
00:41
路飞与唐舞桐
Рет қаралды 64 МЛН