React Navbar Tutorial - Beginner React JS Project

Поделиться
HTML-код
  • Опубликовано: 4 июл 2020
  • Learn how to create a React Navbar Menu in this beginner React JS project tutorial. We will make a navigation menu that slides out into a sidebar and utilities a hamburger menu icon that you can toggle on and off to open the menu. The navbar will be a navbar component and will include all the props and functions.
    If you've ever wondered, "How do you build a navbar in react?" or "How do I create a navigation bar and sidebar in react?" then be sure to watch this video all the way to the end to see how I created my navbar.
    If you want to follow me along my coding journey, be sure to subscribe :)
    / @briandesign
    Check out my playlist to see my HTML, CSS, & Javascript Tutorials
    • How to Make a Website ...
    How to create a Navbar with HTML and CSS
    • How to Make a Responsi...
    Udacity Front end Developer Nanodegree
    • Udacity Front End Web ...

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

  • @karinacabanikova5489
    @karinacabanikova5489 2 года назад +6

    Thank you so much Brian for this ! I spent solid 4 days trying to find an easy to follow tutorial how react works and how to build a nav bar ! I genuinely wanted to cry and give up :D Your video is so easy to follow with no random unexplained surprises. I learned so much today, I gained more confidence in my knowledge of css and js and I finally understand how to make react work and structure :D thank you !

  • @FPVNOVAA
    @FPVNOVAA 3 года назад +47

    Bro thank God for you as a person, i'm learning react and it's been overwhelming just trying to understand some things, but you make me feel and learn so much in such a small amount of time. You're a kick-ass teacher and it motivates me to learn even more because you yourself started learning less than a year ago. So I guess it is also possible for someone like me

    • @briandesign
      @briandesign  3 года назад +11

      Thanks Kelvin! Yeah I noticed a lot of courses were teaching concepts that were too hard to understand, so I figured I just make the basic building blocks of a site and I just started with a navbar, then body section, then footer and it helped me learn it way easier and actually made sense vs building a random app that we would never actually use. Also, staying consistent is key!

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

    finally found a seperate video on navbar react .Kudos to you!

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

    You explane everything very clear from the begining to the end, help me a lot with my project thank you Brian.

  • @harrisngwenya4120
    @harrisngwenya4120 3 года назад +5

    This tutorial is so amazing, I subscribed to your channel before I was even halfway into the tutorial, thanks Bro.

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

    Awesome tutorial! Helped me a lot now while creating my final project for school! :)

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

    This guy going off. Great Vid brother!

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

    This tutorial is paced very well with the perfect amount of explanation

  • @jonathangemme8226
    @jonathangemme8226 Год назад +1

    This is helping me so much with my first dev job, thank you man!

  • @md.wahidulislam416
    @md.wahidulislam416 3 года назад +1

    Thank you, Brian. This was a very informative and clean tutorial. Much appreciated.

  • @sebastianestay
    @sebastianestay 3 года назад +13

    Nice tutorial. In the mobile version, I've modified the .nav-menu class in Navbar.css because the nav-items were overlapping at the top. Changing the height to something larger than 500px fixed the problem but it's hardcoded. What I did was to justify the flex items to the top and then defined the height of the menu using vh units:
    .nav-menu {
    display: flex;
    justify-content: flex-start; /* I added this */
    flex-direction: column;
    width: 100%;
    height: 60vh; /* 500px */
    position: absolute;
    top: 80px;
    left: -100%;
    opacity: 1;
    transition: all 0.5s ease;
    }

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

    Hey Brian, Thank you for this tutorial, I actually enjoyed watching and listening, it really makes things simpler the way you explain in details. I've been studying React's ContextApi in order to really understand it and while watching the tutorial, I realized something.. the MenuItems file you used to store data for the items in the navbar works kinda the same way a ContextProvider file would - providing data to wherever it is needed, except in this case it's mainly for MenuItems. The difference is basically the set up of a context file(createContext()) - the tiny bit of difference that react tells us exists. I feel storing data this way still gets the job done without the use of ContextApi - please correct me if I'm wrong

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

    You are awesome, clear and concise! Subscribed!

  • @SriRam-fn6tx
    @SriRam-fn6tx 3 года назад +1

    I really love your work...Appreciated !!.. Hope you will become the topmost
    youtube channel soon.

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

    Great tutorial! It was easy to follow along and your explanations made sense. You actually don't need to set the top positioning of .navbar-logo and .menu-icon to 0 in your media queries. They'll be center aligned anyway, so you won't have to use any translate properties that way. The only thing you may need to set when not using top and translate is a margin-right of 20px on .menu-icon. Hope that makes sense. Anyway, thank you for the great tutorial! :)

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

      Thanks Anton! yeah I refactored a lot of code since I posted this and made new videos using react hooks and styled components

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

    This tutorial was perfect!! Creating my first react website with this navbar

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

      Nice! feel free to checkout the new react navbar tutorial I made using hooks and router

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

    you are killing it man :)

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

    Already seen your react videos. So easy explanation. Easy and clear, thanks from Bangladesh.

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

    Thanks for the clean tutorial, helped me out a bunch

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

    Good job Brian, what I did to remove the ' Button ' component was put the component inside a ' div ' and gave a className, then inside the media query just target that class to set it to ' display: none '.

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

      That is smart, thanks you helped me a lot.

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

    Really enjoyed this tutorial.

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

    quality content bro, keep it up! You are doing great!

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

    Have to agree with everyone here! You are really good! Brilliant tutorial.

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

    dude, this is fantastic. I really like how you explain the JS, and that CSS is magic!

  • @felixpohlmann6258
    @felixpohlmann6258 3 года назад +12

    Finally a freakin' competent tutorial full of useful knowledge! Hate the trend thats going on at the moment where they advertise programming as direct gate to unlimited wealth.... broken society :( Go on like that! You really simplify things without leaving important information out! :)

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

      Thanks Felix! Yeah I noticed there's almost no tutorials for regular things that we all need for making websites, so I just figured I'd make my own version and share it

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

    Really a lot of knowledge here, sometimes I wish you would explain some things better/more structured, because I seem a little confused here and there as a React beginner. Keep this awesome stuff up man!

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

    Thanks Brian, very useful and helpful for beginners :-)

  • @angele.t.2528
    @angele.t.2528 3 года назад +1

    Easy and clare, thanks from Mexico.

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

    this was great. thank you so much!

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

    Nice work man💥

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

    this is fun! Thanks Brian!

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

      Thanks Aby! I just posted a new react navbar vid showing 3 different designs if you wanted to check that out

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

    Thanks for this tutorial. I'm like 10 days deep in React :D not much... I know. I was able to remove that nav-links-mobile section all-together. It wasn't needed I guess. I moved sign up inside ul and styled that in media query.

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

    Thank you very much. I learned a lot from you. It was a great video.

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

    This is a very informative video.Thanks!

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

    thanks boss! going to watch this tomorrow lol

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

    I thought at the beginning that this tutorial was going to require some knowledge of Bootstrap but I am satisfied to have produced using the tutorial a nav similar to that of bootstrap

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

      yeah all my videos are made from scratch using css

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

    Thanks a ton for this

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

    Great video! 😊 can you please do a continuation video for how you’d make a dropdown menu from this?

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

    thank you bro, good job

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

    Thank you!)🤝

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

    Very Good, Thank you very much, from Brazil :)

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

    Hi Brian,
    Correct me if I'm wrong but in this tutorial, when you're setting the location of the .nav-menu (ts 50:00) to left: -100%, without overflow:hidden enabled, your navbar is floating off to the left in broad daylight. I just want to make sure because when i side scroll with your code, it's there in my implementation without any overflow css.

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

    Definitely like!

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

    Very Helpful

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

    Good one bro. Thanks for sharing with us.

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

    Great video!

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

    thank you brian

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

    What a cool-axx dude for doing this.

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

    Hi Brian I have an HTML sidebar and I want to add a stretchable div/flex box that can be dragged from right to left - do you have any videos for this?

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

    Dude, great video. Easy to follow along with, even while I was folding laundry lol. How long have you been learning doing web dev? I've been doing codecademy on and off for react about a week and I feel like I'm just now understanding a little. Good stuff though, subscribed.

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

      Thanks William! its been about 5 months or so for learning code. I've been documenting everything since day one, so if you check out my earlier videos I show the first day I started learning code. I've made a bunch of Wordpress sites before knowing code, but only started coding recently
      You should check out the free react course on scrimba by bob if you wanna get a really good intro course. It's also on youtube from freecodeacademy and has like 1.8 million views.

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

    this is a great work broo

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

    Really good stuff

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

    On your Button component add className to export const Button = ({ .. to pass it through, append ${className} inside the classname string, then add a class name to the Button when you call it,, then replace Button in CSS with .classname (to hide only this button)

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

    This is the one where I start learning ReactJS and move on from HTML CSS, AWESOME tutorial !!

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

      nice! this video is older and I use classes, but in all my new react website videos I use hooks which is more updated and recent

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

      React isn't based on html and css. It's javascript. If you haven't coded in js yet, react should NOT be your next hurdle. Study js for months before starting react.

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

      @@creaky2436 thanks for letting me know, though i do have a good hand on js :)

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

    great work!

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

    At 50:00 why is he setting the .nav-menu for the mobile menu to 500px? When I had this set to 500px it cut off the margin for the sign up button and when I added or removed more items to the nav-links array the menu would either be too large or too small.

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

    Great video! :)

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

    Thanks for the video, when we declared the menu items and we placed (title, URL, and Cname ), how can I use the URL to navigate through the pages of my project. So under src, I created a file called pages and I created the pages with their respective files( ex, AboutUs.jsx AboutUs.css ), and I want those tabs to take me to various pages I created, any help?

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

    Nice one, very helpful and I have already subscribed. Please share the code next time, it's hard to follow along without making mistakes. Thanks a lot, I enjoyed it.

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

      a few asked and I linked the code in the comments section

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

    Really really great man. No words to describe for this help. kindly help in one thing here. I don't know how to highlight the active tab. New to CSS and don't know how to pull it off.

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

    do you have a link where I can see / download this code?

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

    what is the plugin that adds the colored bars between your formated lines.

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

    ThankS!!!

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

    How would i add two buttons for example if i wanted add a button for sign in and sign up?

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

    How would you add Internationalization to this project? Will you be populating the menu items from translation.json?

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

    Is the font awesome CDN still available it looks like you have to pay for it now but I do see an option for a "

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

    Thanks a lot for the tutorial.
    Is it possible to make it slide from the top instead of the left?

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

    did you use the router and link this video,when I click the item navbar go to another page ?

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

    thank you very much! make more videos!

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

    thanks great

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

    Gracias!
    :D

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

    Hey Brian! i have another question: As a beginner in react, the basic principle I have about the framework 'is that you should make everything become a component (if possible), so analyzing the file MenuItems, it would not be better to create a component instead of repeating - Title, menu, Name... - multiple times? thanks in advance

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

      think of the components as the structure of your website. So, navbar, hero section, services card, basically anything that can be displayed or reused across your site. The react docs states this "Components let you split the UI into independent, reusable pieces, and think about each piece in isolation."
      But honestly I would just keep making projects and learning react and you'll start to understand everything.

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

    thanks for this tutorial Brian!! can you tell me which extensions you use ?

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

    Hey Brian ! Loved the tutorial and the teaching style. Is there a reason for not using React Router for your navbar ?

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

      check out my new react navbar video with 3 designs. I use react hooks and router there

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

    nice video!

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

    thank you

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

    can you tell which background theme you are using?

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

    nice video. I would just recommend that u start from mobile view because in my browser the padding/margin of the logo for example seems to be a bit off. Thanks a lot tho!

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

      ah yeah that was just a filler logo, so ideally you'd replace it with an actually image and then you can customize the sizing

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

    Good one!

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

    Gracias bro

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

    Hey brian, In navbar. Js file I am trying to redirect this page to sign up form by clicking on signup button. But I am getting navbar. Js page along signup form.
    Can you help..

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

    what are u using theme for vs Code ? pls say

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

    Awesome video... Can u help if I am trying to navigate to any try.js by just say services button in navbar...what should I do additionally

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

    hi Brian ! this is excellent video! I'm really glad that I found it :)) just have one question, do you have an idea what lines of code should be added that you can close the menu by clicking somewhere else than on "x" ? and another question, when you click on "home" - what should I add to the code that the navbar will hide?

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

      So if you check out my recent react website video I made a completely new navbar with a separate mobile menu dropdown that does the effect you're taking about. Also, I used react hooks to make it to vs in this vid I used classes.
      But in short you'd need to add the toggle function that you have on the X onto the entire div at the top, so it triggers the function when you click anywhere on the menu. But with the new method I used in my recent react website vid, it is way easier and allows you to add more customization vs the way I did in this video

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

      @@briandesign thanks! I found everything that I needed !

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

      @@jwiesek awesome!

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

    The tutorial is amazing but you know what would be even better? Having the code hosted on Git platforms. :)

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

      github.com/briancodex/react-navbar-v1 it is

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

      ​ @Brian Design thanks, but you might be put github link on description

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

    Hi there,
    In 2022, fontawesome v6 there is no cdn. If i change for fontawesome v5 i can use cdn only when i have pro plan :(

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

    when i call items.cnam in the class name and then I go to put .nav-Links in css but nothing change in the items when I put some css any souliton ?

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

    Hey! Good tutorial! May I ask what vscode extension you're using for the colored bars on the tabbed spaces?

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

      check out my vs code extensions video

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

      @@briandesign good teached, and what kind of color did you fix for this code editor?

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

    Hey man, I see you have a few navbar react tutorials. Which one do you recommend starting with? I imagine your most recent one?

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

      Depends on how much react you already know. If you are just starting, then you can watch my earlier react website vids cause I use css for styling, but if you know styled components, then you should check my recent ones.
      The recent ones I posted are more specific focus with animations, but my ones I posted like a month or so ago are more general websites designs

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

    Check out my New React Navbar Dropdown Tutorial using Hooks & Router
    ruclips.net/video/T2MhVxJxsL0/видео.html 👈
    Check out my new React Website Tutorial that is fully responsive
    ruclips.net/video/I2UBjN5ER4s/видео.html 👈

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

    Bro really said, bee as in honey bee, his thought process is on a whole new level, it beats mediocrity for sure, he is like one of those guys, don't do what they think

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

    Can i add this to an existing react js project ?

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

    great video

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

    Hey Brian, this tutorial is awsome. Love to watch more like this. A small suggestion from my side if you don't mind :- Please do it fast. For a such a small component, it took almost 1 hr. Patience hits out. Nevermind these are much elaborative but video is too slow to watch for a long time.

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

    What is the plugin which you are using to auto type some of the sentences? That could be a lifesaver for me.

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

      I know Im super late and you might have had an answer by now but if anyone needs it its called "React snippets".

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

    I appreciate your videos, I've been working on a website for a gaming community & your videos have been extremely helpful. I've looked through this codes attempting to locate how to Change the "React" & Logo in the Top LH corner of the Navbar. I'd like to change them to the Logo for the Website I'm creating. I can't seem to ID the call for the logo anywhere in the src. Can you point me to where this could be accomplished? Thanks!

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

      NM I found it >_<
      Thanks again! I enjoy our long conversations LOL

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

    omg you are very cool

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

    how to change the react logo to a personal png or svg logo ?

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

    Many Thanks for sharing bro!
    I wish if you used Hooks bro, but thanks again!

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

      Check my recent navbar 3 designs vid I used hooks. Basically every video after this one I used hooks

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

      @@briandesign Many thanks for your response brother!! Amazing!
      please continue make more React videos and I'll support your channel by keep clicking on the ads!

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

      Thanks!

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

    Nice tutorial, very straightforward, but I need to create two buttons instead of one, anyone know how I can do that with this procedure?