Advanced Dropdown Menu - React & CSS Animation Tutorial for Beginners

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

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

  • @dagoeneko
    @dagoeneko 4 года назад +498

    I honestly have never seen a tutorial this short with such good quality, incredible job 🙌🏻

    • @Fireship
      @Fireship  4 года назад +50

      I try to pack 1hr into 10 minutes, so this video was actually 6 minutes too long ;)

    • @darkfoxwillie
      @darkfoxwillie 4 года назад +1

      @@Fireship any possibility you do this step by step? sometimes is too fast lol

    • @yusukeko78
      @yusukeko78 4 года назад +2

      Seriously, it feels "just right" to let you think through how to do it and actually let you absorb it. A phenomenal job for a tutorial.

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

      @@darkfoxwillie looool just pause it

  • @Ctrl_Alt_Elite
    @Ctrl_Alt_Elite 4 года назад +382

    I've just started digging into React, would definitely love to see more stuff like this

    • @Ctrl_Alt_Elite
      @Ctrl_Alt_Elite 4 года назад +44

      @Malik Bagwala Maybe if you're experienced in React but for someone new to React this is still very informative, especially if it's the first frontend framework you're learning. It helps you see how other people work in React, i.e. their development process. You can adapt the stuff you find useful to your own workflow. It's all about perspective my friend 😉

    • @upthinker2336
      @upthinker2336 4 года назад +7

      @@Ctrl_Alt_Elite you said it perfectly

    • @patrickmanfra9205
      @patrickmanfra9205 4 года назад +1

      agree. as a front end person, this was helpful to see made in react

    • @olenahryhorets1676
      @olenahryhorets1676 4 года назад

      I've just started with Angular2, but it seems to me that I need React too

    • @xq_nemesis
      @xq_nemesis 4 года назад

      Wölf I completely agree

  • @philheathslegalteam
    @philheathslegalteam 4 года назад +628

    Day 35 of quarantine: Fireship now doing React.

    • @ericaskari
      @ericaskari 4 года назад +3

      🤣😅

    • @peterveliki7918
      @peterveliki7918 4 года назад

      Haha :D

    • @Fireship
      @Fireship  4 года назад +78

      The world is turning upside down!

    • @facinick
      @facinick 4 года назад +4

      @@Fireship hey, can you reply to my comment "Hey, can anybody let me know what if I want to add more levels to it (like this has primary->secondary, what I want is a->b->c->d->etc, how would the transition properties work then? just adding submenus to submenus in the source code of this obviously doesn't work properly out oft he box."

    • @Qexia
      @Qexia 4 года назад

      ​@@facinick I'm not very keen on React but I assume the principle should be the same. Assuming you'll render data from an object that you pass. Check if a property has children, if it does. Have it render a secondary menu. IDK how it works in React but I've already done something like that in Angular.

  • @mrviometal4948
    @mrviometal4948 4 года назад +86

    THIS....IS....AWESOME!
    Keep the react reverse engineering videos coming dude!

  • @chillingwithkids552
    @chillingwithkids552 2 года назад +2

    I never seen tutorial with 1x speed other than this... no bullishitting before and after the videos.... clear and crispy from start to end ..well done mate

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

    I started my react journey last week and I really enjoyed building this drop-down menu with React

  • @nirmalpatel29
    @nirmalpatel29 4 года назад +36

    We all would love to more React videos. :)

  • @jaroslavhuss7813
    @jaroslavhuss7813 4 года назад +1

    I really love this guy's work since he is not doing "beginner lvl videos" all the time! This guy is pure javascript god! Please, keep it going!

  • @rashidulislam9636
    @rashidulislam9636 Год назад +4

    Pretty complex to understand for a beginner like me but after understanding and being able to create similar results, I am impressed with your code. The layering of things is beyond amazing. I wish to reach where you are! Thanks !

  • @sumanth3036
    @sumanth3036 4 года назад +3

    You finally on React, please continue. I am glad. Looking forward for more React content

  • @mrala
    @mrala 4 года назад +127

    oww fireship doing React; someone wake me up

    • @Fireship
      @Fireship  4 года назад +52

      I told myself I'd never do it, but these are crazy times in the world.

    • @aditya_gupta
      @aditya_gupta 4 года назад +5

      @@Fireship why?

    • @kotel94
      @kotel94 4 года назад +9

      @@Fireship do it more, it's fun!

    • @LarsRyeJeppesen
      @LarsRyeJeppesen 4 года назад +1

      @@kotel94 No observables, no thanks.. it's so old fashioned

    • @mrala
      @mrala 4 года назад +3

      @@Fireship We hope these crazy times last longer and happen more frequently :)

  • @sathishshaj7815
    @sathishshaj7815 4 года назад +2

    Finally 🔥 got into React... If I haven't watched this I would never use css transition in my life

  • @IOSAppCrazy
    @IOSAppCrazy 4 года назад +11

    Dude I would love more in this series! I spend a lot of time doing backend, and want to step up my front-end game!!

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

    Am i the only one who feels that i dont know anything about web development when i watch fireship videos

  • @johanndaveldebeer9532
    @johanndaveldebeer9532 4 года назад +1

    Weird how goal oriented implementation can make you understand something better, i learned more about react in this vid than an actual 2 hour react tutorial.

  • @_saurabhshah
    @_saurabhshah 4 года назад +3

    This is so awesome. I never fully understood the css transition group before this video.

    • @Fireship
      @Fireship  4 года назад +8

      Nice! It's actually inspired by ng-animate from Angular 1, so I know it well :)

    • @_saurabhshah
      @_saurabhshah 4 года назад +1

      @@Fireship keep up the good work. & Stay safe :)

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

    Finally, I never understood React until now. What is react? A way to create your own custom html elements, (inside javascript). Is a way to extend what you do with html.

  • @akinjidesleek
    @akinjidesleek 4 года назад +89

    15:39
    Made me think something was wrong with my earphones

    • @HdeHidratado
      @HdeHidratado 4 года назад +8

      I actually jumped a little from my chair.

    • @Fireship
      @Fireship  4 года назад +23

      My fault, bad audio edit 🤕

    • @danisob3633
      @danisob3633 4 года назад +1

      @@Fireship

    • @lololtoday
      @lololtoday 4 года назад +1

      it is really make me freaking out.

  • @thriftykapila8420
    @thriftykapila8420 4 года назад +68

    Also more of react and Code this code that series😍😍love from India

    • @chizuru1999
      @chizuru1999 4 года назад

      Indeed. More react! 🤩 Oh! and don't forget to unstar Angular on GitHub. ✊😉

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

      Yes

  • @phantom7132
    @phantom7132 4 года назад +11

    Annotation @8:36: The onClick-handler works and flips the boolean but due to the fact that setState is asynchronous it is not recommended to get the current state and flip it. Instead just make use of the prevState variable: setOpen((prevState) => !prevState);. This guarantees that the props getting updated 100% as well as the prevState.

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

    Title : Avanced Dropdown Menu
    Fireship : *makes facebook 2.0*
    Good video! Keep it up!

  • @Kazyek
    @Kazyek 4 года назад +13

    Props for making it in a standard way so it works in firefox =D, as opposed to facebook's own, hahah
    Small feedback:
    - There's a visual glitch with the right arrows svg on both chrome and firefox; on firefox, they're too big because they have no fixed size (I gave them a height of 50px and it looks decent).
    - Since you didn't gave them "fill: var(--text-color)", they don't show up on chrome, and show up as black on my firefox.
    - Would be quick and free to deploy the public demo on github pages =D

    • @MrAknur
      @MrAknur 4 года назад

      Helped a lot, thank you! I am on my learning JS way, I think it would be nice to learn together and share some experience through Discord etc. if you would like of course, what do you think?

  • @sumanth3036
    @sumanth3036 4 года назад

    RUclips is fed up with React content already. Here is what Fireship does. Awesome. Would love to more interactive UI content like this

  • @ahmadsalaah
    @ahmadsalaah 4 года назад +1

    I 'v just started with React and I was stuck on doing animation this is awesome ♥♥♥

  • @dazamora
    @dazamora 4 года назад

    The most profitable 16 min I spend on last 4 momths. amazing, new suscriber.

  • @HugRunner
    @HugRunner 4 года назад +11

    It would be cool to see the difference in implementation of something like this in React, Angular and Vue. And, maybe some responsive design aspect to show how to make sure it works on mobile etc. as well.

  • @fatal510
    @fatal510 4 года назад +1

    For the longest time I thought this was the official Firebase RUclips channel...

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

    Shoutout to fireship for doing amazing stuff to my developer journey

  • @curiouslycory
    @curiouslycory 4 года назад +1

    I really appreciate your instructions. They're clear, concise, and just the right level of verbosity.

  • @davidmikan7925
    @davidmikan7925 4 года назад

    I never looked into react and have so far only made simple handwritten websites.. while watching this video my mind just went 🤯

  • @kelleyvanevert
    @kelleyvanevert 4 года назад +2

    Wooo... while the tutorial as a whole is great, I'm surprised to see the bad (& weird!) practice of nesting functional component definitions! At 10:00, the DropdownItem component definition is nested in the DropdownMenu component definition. The result is that no item instance will ever outlive any re-render of the menu, effectively upending the whole point of using a react component. If you want to use a react component, you should not nest the definition. If you just want to re-use some rendering logic, that's also fine, make it a "normal" function (w/o capital letter and props param), so as to not cause confusion, and nest it however you like.

  • @stevecastaneda
    @stevecastaneda 4 года назад

    More React content, please! I didn't realize there was so much hate for it, but I love that you cover them all.

  • @andreasdevjs298
    @andreasdevjs298 4 года назад +5

    We want more videos like this one!! More React!! :D

  • @wheelbegood
    @wheelbegood 4 года назад +1

    Great video - I guess I will binge watch your whole channel ;)

  • @rp2804
    @rp2804 4 года назад +5

    These are the videos we LOVE AND WANT 🙌😍😍😍😍😍❤️

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

    Holy moly! You sir deserve a medal...

  • @MightyMoud
    @MightyMoud 4 года назад +1

    MAAAAAAAAN! I swear to god you inspire me soooooo much! One day I really wanna be like you! I have a very small YT channel but I really wish to be on your level one day!

    • @radubuta5004
      @radubuta5004 4 года назад +1

      Hey man, your weather card tutorial was pretty good for beginners (like me), so keep up the good work, and glad to find you here ❤️

    • @MightyMoud
      @MightyMoud 4 года назад

      @@radubuta5004 Yo! Thanks man! Means a lot!

  • @dealloc
    @dealloc 4 года назад +6

    Nesting components (a function component inside a function component) goes against the composition over inheritance pattern, that React is built around.
    There are a lot of pitfalls such as ending using the wrong variables of props and hooks between components, leading to non-optimal behavior. Not only will it make your components harder to read, maintain and debug but it will also cause unnecessary updates to child components that otherwise doesn't need to be updated-and in this case constructed each time every time your parent component updates.
    If you want to share variables/props around, pass them as props to the child components. This is the recommended way, and lets React correctly handle the lifecycle of components.

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

    Wish all tutorials were at this pace, so good

  • @user-kg5jh2ct4r
    @user-kg5jh2ct4r 4 года назад

    I see that you're slowly transitioning to using React. Have been waiting for this day. Congrats and welcome to React

  • @Andy98221
    @Andy98221 4 года назад +1

    I absolutely loved the video. Im not the biggest CSS fan but I really enjoyed watching it.
    As a suggestion I'd say to put in title something like "Facebook nav/tear down" to help People discover this video

  • @pagalpantipupun
    @pagalpantipupun 4 года назад +23

    I can not count how much I learn from this guy. ultimately awesome. Could you please make some pro tips and more videos on ionic 5.

    • @Fireship
      @Fireship  4 года назад +7

      Yes, some ionic react content is overdue on this channel.

  • @DerJP
    @DerJP 4 года назад +3

    Would love a lot more of these kinda advanced tutorials! Not many people do them. Great video as always btw :)

  • @AustinJohnson-zt5pt
    @AustinJohnson-zt5pt 4 года назад

    Beginner friendly UI tutorials? Yes please!

  • @rkd-me
    @rkd-me 4 года назад

    I really like your tutorials, quick and dense with knowledge!
    I hate when i watch tutorials and for the 10 minutes they talk about irrelevant things..

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

    if you have fixed height nav bar you end up with a non accessible component when you have text with in it. Users should be able so scale text on the page to 200% (that may vary in the EU and US but that is what it is in the AU). When using SVGs directly set the title attribute otherwise screen readers treat them as an image without alt text. Otherwise make sure the link has an accessible attribute like aria-label and the SVG is ignored by the screen reader. Remember not everyone uses the mouse make sure your drop downs are accessable by the open and close being triggered by return (if closed make sure the tab cursor skipps over the links inside the drop down) or use tab and shift+tab to open and close the drop down programmatically.

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

    Hey there! I just wanted to tell you that your content is god-tier, no doubt about that. But the only thing I request of you is to slow down the pace of your voice, as you might know that slowing down youtube's playback do distort the voice, but speeding it up doesn't.
    Please consider this!!!
    Love you, as always❤

  • @aleksszukovskis2074
    @aleksszukovskis2074 4 года назад +1

    0:15 That Tiger looks just... CRISP

  • @monour2840
    @monour2840 4 года назад +3

    Awesome as always, and would love more of that beginner-friendly content.

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

    That’s so great. Now I’m thinking about how to make a mock-up of it to make the developer clearly understand what exactly the functions are and how do they work. 🤔

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

    Need more videos like this, cloning components from popular sites.

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

    Dude this is amazing and so smooth it gives softness vibes

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

    that's some high level react that we've just witnessed!

  • @sl0wlyedits277
    @sl0wlyedits277 4 года назад +5

    Would love more react stuff, great video btw!

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

    I remember that this kind of content was what made me to subscribe. It will be cool that you take it back and let the AI rest for a while. Thanks.

  • @ypucandeleteit
    @ypucandeleteit 4 года назад

    these are some pro frontend skills. Great practices - please keep making high-quality videos

  • @abhinav.sharma
    @abhinav.sharma 4 года назад +1

    @Fireship Yes man! We would love some UI tutorials! 🔥🔥🔥🔥🔥

  • @chregano
    @chregano 4 года назад

    CSS Transition group feels like ng-animate. Very cool. I am an AngularJS (hide) developer learning React now. Great video as usual. More React content would be awesome. Thanks!

    • @Fireship
      @Fireship  4 года назад +1

      It's exactly like ng-animate 😁

  • @tobeqz7065
    @tobeqz7065 4 года назад +31

    YESS! More react content

  • @SquashBox
    @SquashBox 4 года назад +1

    This video and the one where you showed us how to add color themes to websites were my favorite. These beginner friendly tutorials are fantastic!

  • @adnanamin3666
    @adnanamin3666 4 года назад

    Just got into react recently, loving it! Will appreciate more videos! 👌✌️ 💥

  • @daryllman
    @daryllman 4 года назад

    wow learnt so much about css in just 15mins. Concise and informative!

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

    Step 1 : this is easy
    Step 2 : bit complicated
    Step 3 : Aww shit🤯

  • @shreerangvaidya9264
    @shreerangvaidya9264 4 года назад

    Uploaded just when I needed it.

  • @santoshdahal4911
    @santoshdahal4911 4 года назад

    yes on beginner-friendly tutorial.... more conceptual lesson rather than step by step walkthrough....I wouldn't feel like I am doing on my own plus we can learn a lot more concept

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

    wish i had found your channel sooner, great content and most importantly you explain the vocabulary really well. Thanks for the knowledge!

  • @adamm2716
    @adamm2716 4 года назад

    this was really cool and i learnt alot. i tried taking it the next step further and making each item its own component but i messed it up. lol so now i am watching it again to see if i can learn more.

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

    There is so much great information, explained so well, packed into this video.

  • @gabrielgutierrez6282
    @gabrielgutierrez6282 4 года назад

    I would like to see more react content and small features like this. Thanks for the video!

  • @davidvideauortega287
    @davidvideauortega287 4 года назад +10

    Great tutorial! Pretty high quality. The end result is awesome!
    Would you consider making the exact same menu using Angular instead of React? It would be really interesting!

  • @MJ-yz9ik
    @MJ-yz9ik 2 года назад

    Thank you ONE PUNCH JEFF for this incredible content

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

    You should use the previous Value on the setOpen Function which is given you as a Argument in the Callback of setOpen() instead of using the current state. Otherwise you maybe open the Dropdown-Menü but maybe wanted to close it.

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

    you're a god of tutorials

  • @spongechameleon6940
    @spongechameleon6940 4 года назад

    Bruv I just started building an animated drop down tonight and lo and behold...

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

    I had to rewatch this, time to replicate on my project

  • @jackmaison4209
    @jackmaison4209 4 года назад

    Hooray! Love the react videos. Great content as always. Would love to see more react videos like this.

  • @migueldomingos4570
    @migueldomingos4570 4 года назад +1

    Please use rgb instead of hex values for colors!!!
    Aside from that great tutorial!

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

    This tutorial is awesomeness on steroids👏👏👏👏

  • @nav.r
    @nav.r 3 года назад

    I Bow down to thee my friend... This is an absolutely wonderful video.

  • @sambegstha3516
    @sambegstha3516 4 года назад

    Clear, concise and to the point while saving us time. Thank you!

  • @mehdiabderrahmaneyahiaoui4700
    @mehdiabderrahmaneyahiaoui4700 4 года назад +3

    Thank you for the great tutorial. I have two questions. How to prevent two dropdown to appear at the same time? ( opening one closes the second one) and How to close the dropdown when clicking outside of the modal.

  • @karansagar7870
    @karansagar7870 4 года назад

    great RUclips recommendation ,I want to create website for my semester project don't know how to start

  • @sihamebazi9795
    @sihamebazi9795 4 года назад +1

    Thank you. Incredible explanations. I hope I will see more videos in react.

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

    Thanks for short and informative tutorial, keep up the good work, your are helping a lot here 😁

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

    This tutorial is excellent! Would love to see more React tutorials like this.

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

    Thanks for giving such a nice dropdown menu with React & CSS Animation tutorial for beginners.😇 This tutorial was very helpful for all beginners.😉

  • @RavMucha
    @RavMucha 4 года назад

    I'd just like to say, that this channel rocks. You're great at explaining things.
    Wish list: Beginner friendly Angular & Vue Frontend projects.

  • @rutymaster9572
    @rutymaster9572 4 года назад +1

    Very good, there is the possibility of doing it in angular

  • @herbertpimentel
    @herbertpimentel 4 года назад

    OMG I loved it sooo much, but now I will have to watch several times, I am too dummy to understand everything at the very first time.

  • @planetmall2
    @planetmall2 4 года назад +2

    Thank you for this! Love when you do React projects.

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

    I wish there were more videos of making components like this.

  • @leonlai80
    @leonlai80 4 года назад

    This is cool! Please continue doing something like this.

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

    Very nice vídeo. Nice and clean. We need more this kind of vídeos

  • @LeCrowTV
    @LeCrowTV 4 года назад

    The presentation of this video is on point

  • @spiceydev
    @spiceydev 4 года назад

    You have to idea how much this just helped me!!!!

  • @WesleyFranks
    @WesleyFranks 4 года назад

    Definitely love these beginner videos

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

    my comment is number 500 i was wondering if there is any plugin in wordpress doing the same thing Thanks for this amazing video ❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️❤️

  • @duytan4802
    @duytan4802 4 года назад

    Please make more videos like this, love to see this kind of content. Thank you so much

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

    damn, thats too good, I'd like to see more content like this from you

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

    Nice! I've been struggling with getting smooth transitions on components that are mounted and unmounted depending on state. Height is especially tricky because you need to know how tall the container is going to be once a child is added or removed from it.

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

      Would be cool to see how to tackle it masochistically without the CSSTransition dependency though