Responsive Navbar Tutorial In React JS

Поделиться
HTML-код
  • Опубликовано: 22 фев 2022
  • Responsive Navbar Tutorial In React JS
    In this video I'm gonna show you how you can create a responsive navbar in react js.
    ----------------------------------------------------------------------------------------
    Source code: github.com/Index-Zero-0/Respo...
    Please LIKE and SUBSCRIBE for more content and supporting!
    #responsivenavbar#navbar#reactjs#reactjstutorial

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

  • @Keras___
    @Keras___ Год назад +5

    Simple and straightforward, all tutorials had to be like this, congratulations!

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

    Amazing tutorial mate, thank you.

  • @adolp.h
    @adolp.h 11 месяцев назад

    He just earned my subscription, great tutorial.

  • @bernardsamapoh3619
    @bernardsamapoh3619 Месяц назад

    This tutorial has solved my react responsive challenge. Many thanks

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

    Simply The best RUclips video on this Topic.
    But a suggestion would be for you to change your intro part with you talking because it seems the video has an audio of Music not your Explanation.

  • @learningtocode4261
    @learningtocode4261 Год назад +2

    Very Nice explanation and you did a great work

  • @yasuda1618
    @yasuda1618 9 месяцев назад +1

    Great! Thanks for helping

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

    Thanks Bro... Excelent Tutorial!

  • @intensity9523
    @intensity9523 7 месяцев назад

    great tutorial! thank you a lot for helping me fix this in my page

  • @bluewonk9232
    @bluewonk9232 Год назад +11

    Great tutorial ...Thanks man !
    Guys....
    use "display:none" instead of "visibility:none"
    visibility:hidden hides the element, but it still takes up space in the layout. display:none removes the element from the document. It does not take up any space.

    • @antwiebenezer9715
      @antwiebenezer9715 8 месяцев назад

      Yes, It's true. I first used visibility and it was giving me problems as you said so I later used display: none;

    • @vini3017
      @vini3017 3 месяца назад

      Thanks! You just answered my question before I asked it lol

  • @oliveira1820
    @oliveira1820 8 месяцев назад +1

    Thank you for this tutorial.

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

    Very helpful thanks ❤🎉

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

    Great tutorial thank you!!

  • @juansebastianbowers730
    @juansebastianbowers730 Год назад +6

    Great tutorial. I would suggest explaining briefly what a font icon is for people with less experience (ex. The Font Icons are a subset of icon groups that you can access through the react-icons package)

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

    Thank you for share your knowledge :)

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

    Wow Awesome tutorial
    💥💥💥💥💥

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

    Thank you Bro !!!

  • @darshikatalaviya5647
    @darshikatalaviya5647 10 месяцев назад

    great tutorial thank you so much

  • @djairbatista6311
    @djairbatista6311 2 месяца назад

    thank you very much! God bless you

  • @underworld-of-gaming
    @underworld-of-gaming Год назад +2

    Thanks ❤️

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

    Thank you!

  • @AkshayParkad
    @AkshayParkad Год назад +27

    in case you are using react LINK .. you have to execute the following on onClick
    const hideNavbar =()=>{
    navRef.current.classList.remove("responsive_nav")
    }
    otherwise, navbar won't close in responsive view when user clicks on the nav link

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

      Bro you saved my day

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

      @@learningtocode4261 😅😅

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

      thanks👍

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

      Where will it put, inside the onClick function.
      I entered the hidenavbar function inside onClick, it got error.
      Will you please help me out

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

      @@athul__4614 check it well because i tried the same thing and it worked for me

  • @ugurarslan5673
    @ugurarslan5673 2 месяца назад

    great. thank you

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

    Thanks!!

  • @rahulsingh-bk3wd
    @rahulsingh-bk3wd 2 года назад +6

    buddy you need to increase your font size cause when we use split screen while practising i don't think its easier to read

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

    thank you so much

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

    Nice video bro

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

    good job ♥

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

    Thanks a lot))

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

    thank u so much sir

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

    Very nice video

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

    Thank you

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

    thanks bro 👍 👍

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

    Good!!

  • @ikebelida1528
    @ikebelida1528 3 месяца назад

    NICE🎉

  • @MehediHasan-zx3ye
    @MehediHasan-zx3ye Год назад +1

    thank you

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

    Beauty nav

  • @bigbangriders7177
    @bigbangriders7177 4 месяца назад

    Awesome.....:)

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

    Hi, I'm just curious why did you use href on the menu links instead of nav link?

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

    Love this tutorial, im new in react and im trying to figure out how can I navigate through pages when I press the

    • @index-zero
      @index-zero  Год назад +1

      For navigating between pages use "React router".

  • @maliabadziukh711
    @maliabadziukh711 Год назад +5

    Great tutorial, everything works as it should, but I want to get rid of the transition when the window gets smaller (the menu going up) and can't figure out how. I've tried explicitly setting "transition: none" everywhere but no effect, can anyone help?

    • @index-zero
      @index-zero  Год назад +1

      I'v fixt it you can check the source code again

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

    Hello! Where can I find the code? I have some errors and I don't know how to fixed them

  • @calebakpomughe6566
    @calebakpomughe6566 2 месяца назад

    how do i input submenus into this and to make the submenus look different for both mobile and desktop

  • @mahnazataie1116
    @mahnazataie1116 8 месяцев назад

    Why I have an error with pressing the button and says can not read properties of undefined (reading class list)

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

    Awesome tutorial! Thank you so much. But i have a problem, why is my error code indicating that useRef is not defined?

    • @index-zero
      @index-zero  Год назад +1

      Did you import it?

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

      @@index-zero I have imported and there's another error hat's popped up, the error reads: React Hook "useRef" is called in function "navbar" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use"

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

      @@teenawinsor4982 useRef didnt worked for me so i guess its better to use useStatge and useEffect witch worked for me u can check these hooks code on stackoverflow

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

    Please help me. I need to make the hamburger menu appear since the beginning. And the functionality to be the same. Can you please help me ??

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

    quick question great video btw! when i ran my code I came across this error that says ./src/App.js module not found: cant be solve './components/Navbar/Navbar'

    • @rastamanjj
      @rastamanjj 10 месяцев назад

      control the path of navbar component

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

    and how to add other pages to navbar for navigation ?????????

  • @rico5424
    @rico5424 7 месяцев назад

    I noticed that the hamburger menu does not disappear when clicked on

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

    i have a problem
    actually i am using navLink so when i click on navLink navbar is still open so please tell me what i have to do
    for auto close navbar when i click on any navLink

    • @index-zero
      @index-zero  Год назад +1

      Add this "onClick={showNavbar}" to your navlinks.

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

    how to implement using jsx file instead of using js file as a component?

  • @ABHISHEK-yi4ix
    @ABHISHEK-yi4ix Год назад +1

    at least you have to give us a source code

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

    Anyone know how he typed "ffc" and got a skeleton of a component on the screen?

  • @askoldtsentseusti-1122
    @askoldtsentseusti-1122 Год назад +4

    when im resizing the window animation of transition is playing, what i supossed to do to fix that?

    • @askoldtsentseusti-1122
      @askoldtsentseusti-1122 Год назад

      you have the same problem on the video time-code 19:29 19:34

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

      I wonder the same!

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

      so how to fix it?

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

      I do not think that's an issue coz when we implement it in an actual project, users won't constantly change screen sizes, that can only be done in desktop when resizing or using in screen pop-ups in tablets/phones, so mostly screen size would be static, hence we just have to ensure proper functioning in constant screen size, although I do not know how to fix that too

  • @abduzarkhabib5978
    @abduzarkhabib5978 5 месяцев назад

    but how can i create new empty react file? sorry imma newbie in this:)

  • @yellowrice8633
    @yellowrice8633 Год назад +8

    When the screen size is minimized and i press the fabars. It doesn't display the nav items. I've checked the codes multiple times. Not sure what to do.

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

      Same

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

      If you will figure it out please tell me

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

      Got it! make sure that the spelling of responsive_nav is the same in css and js :D

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

      add onClick on both button with the same value

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

    This doesn't work with module css files

  • @infindgiti5576
    @infindgiti5576 Год назад +2

    When clicking the links, the menu does not hide again 🤣 we have to implement that behaviour

    • @sang4005
      @sang4005 10 месяцев назад

      Exactly😢 it is so irritating

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

    I'm getting this error: TypeError: Cannot read properties of null (reading 'classList')
    I just tried , but can't fix it

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

    My useRef isn't working. When I click on the navbar icon it doesn't respond. Can I get help please? Thanks.

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

    Awesome tutorial but please I need a help what if I want to move the nav link to right side not center on the desktop view how can I please will be glad if anyone can be of help

    • @index-zero
      @index-zero  Год назад +1

      move Logo inside nav and add this to css:
      nav h3 {
      display: inline-block;
      margin-right: 1rem;
      }

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

      @@index-zero thanks for taking your time to reply but please after i did as u said at desktop view it move both the logo and link to the left side not right and on media view it move the icon to the left side also looking forward to hear from you please

    • @index-zero
      @index-zero  Год назад +1

      @@agboluajelateef7467 In that case change the return in then Navbar component to:





      Home
      My work
      Blog
      About me




      LOGO

      then remove nav h3 {
      display: inline-block;
      margin-right: 1rem;
      }"
      and add these styles :
      header div,
      nav {
      display: flex;
      align-items: center;
      }

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

      @@index-zero thanks so so much it now work but the changes I made is i just put the nav link inside a div and Add CSS as u said now what I need thanks

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

    please sir, why did you use visibility: "hidden" and not display: "none"

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

      visibility: "hidden" will hide it but it's still included in the DOM (Document Object Model) / "your website"
      while the display: "none" will completely remove it from the DOM.

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

    My buttons didn't work to drop down the nav or remove the nav

    • @index-zero
      @index-zero  2 года назад

      Chech the call back function that runs when you click the button also check the css file and see if it is correct.

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

      Okay i will do that once I'm home

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

    I enjoyed the video you where not fast

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

    how to add route with this navbar ?

    • @index-zero
      @index-zero  2 года назад

      First import Link from react router then just change a tags to Link.

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

      @@index-zero icant bro , can u help me ? u have discord or smtng ? , wen i import the router, the navbar is gone

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

      @@muhammadajiefarhanedopange9568 ruclips.net/video/bdOHxlrS5UM/видео.html&ab_channel=TovCode

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

    واضح انك عربي

    • @ben.j_official
      @ben.j_official Год назад

      اتوقع ايراني مو عربي من اللهجة مبين

  • @elif-gazioglu
    @elif-gazioglu 9 месяцев назад

    why didn't show the screen. you just write and after that show us...

  • @user-dm2kl7dw2h
    @user-dm2kl7dw2h 6 месяцев назад

    u even didnt click on some button....

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

    Using classlist with react ?? really ??

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

    DON'T WASTE YOUR TIME! This video shows a full-screen navbar and not a sidebar.

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

      The video is really helpful, besides you could implement a sidebar by tweaking the code and using translateX()

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

      @@lenduking I found it useless

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

    videos without source code are useless just sayin

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

    Thank you

  • @thequantum-plator
    @thequantum-plator 8 месяцев назад

    thank you