React Sidebar with Dropdown Menu Tutorial - Create Sub Navigation

Поделиться
HTML-код
  • Опубликовано: 19 май 2024
  • Learn how to make a React Sidebar with Dropdown Menu. We will use react hooks and styled-components to create this sub navigation. You can navigate to other pages using react router. Feel free to refactor the code and let me know any ways to improve it!
    Timeline
    0:00 What we are building
    3:44 Creating Components
    7:24 Creating Data File
    16:20 Creating Sidebar
    30:06 Creating Sub Menu
    47:38 Creating Pages/Routes
    Access Source Code
    www.codavilla.com/posts/build...
    If you want to follow me along my coding journey, be sure to subscribe :)
    / @briandesign
    Regular React Sidebar without dropdown
    • React Sidebar Navigati...
    React Website with smooth scroll
    • React Website using St...
    React Navbar 3 Designs
    • React Navbar Tutorial ...

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

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

    Your tutorials are really amazing, they add a lot of value, you deserve many more subscribers!

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

    Managed to get this working using only two components and recursion! Thank you so much for this! Amazing!

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

      Please share through videos, I'm really struggling here understanding React and the whole web syntax coming from a backend Java developer

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

    I'm using your sidenav on my project. Thanks mate! what a great Guru

  • @robertrodrigues822
    @robertrodrigues822 3 года назад +7

    Toop!! Muito obrigado pelos conhecimentos, confesso que pensei que fosse muito difícil e que não iria conseguir compreender e entender e também aprender, mas agora que conseguir finalizar, percebo que foi simples é muito fácil de entender, por mas que precisei traduzir a vídeo aula rsrs. Desejo todo sucesso e continue trazendo mais conteúdos bons, breve breve vai ser eu montando um canal também.

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

    Love you dudeeee! Omg im just starting to create this app for my company and I had no idea to do the drop box and dude! THANK YOU! After days, I finally figured out

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

    You are really great! I am doing my react project with the help of your tutorials. Thanks a lot lot. Please continue uploading amazing videos!

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

      Thanks, will do!

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

      @@briandesign hello one question, can you change the background of the button or just style the button when its opened, and when closed it returns back to what it is?

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

    I would love to do a code along with a full React+SCSS web app tutorial
    A tutorial about Authorization with Json Web Tokens (JWT) and Refresh tokens would be neat as well :)

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

    Thank you so much brother for this wonderful tutorial, I was looking for the same from long time for dashboard kind of layout

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

    Really nice! I love that you can easily add menu items by changing the data file.

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

    That's exactly what i need right now! Thanks u so much! Keep it uppppp

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

    Thank you... i recently started learning react!! it has given big boost to my learning :) :)

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

    I love using styled-components as well..they make working with css so easy and dynamic

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

      Yeah styled components are awesome

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

    This tutorial saved me !!!! Thank you so much ! I just subscribed

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

    Good job Brian. I love your content. Keep going bro.

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

    Awesome work and really easy to follow along with and learn!
    I'm wondering if you can make the components behind the Sidebar to be able to shrink and grow in width to avoid content being lost behind when opened?

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

    I learned alot from you. Thank you very much ❤️

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

    Thank you sir, it was just what I was looking for. This was an excellent tutorial and is much appreciated. Can I ask how you would have all of the items that have sub items expand initially?

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

    My fav react tutor! ⭐

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

    Thanks this helped a lot! Great video!

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

    Great Man ! Please Do a carousel (auto) with styled components !

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

    Great tutorials, it's very useful for me

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

    Very Good, this made a lot of sense

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

    Thanks for the great video! I did this just today - happened to auto'ly import the latest version of react-router-dom. The Switch made me run around for a while as I wasn't expecting something as key as that might get moved-out/deprecated. Anyone who may face this issue, please use Routes instead of Switch.

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

    Many thanks! You helped a lot

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

    Fue de mucha ayuda. Saludos desde Argentina !

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

    Great Job Sir, literally best content 🙌🏼
    Create my first web look by watching your video. 😋
    Needed this type of tutorial for my Admin dashboard, can you make video on that too? dashboard functionalities with react (e.g. sidebar, topbar, login navbar topbar change with name , logout)

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

    Excelent video, thank you very much!

  • @sunflair-wa
    @sunflair-wa Год назад

    I learned so much by watching you! Thank you very much for this. Question: What if you wanted to put an image in for an icon? Even harder question, what if you had a button with a pseudo::before and you wanted to put an icon in that?

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

    Great job, i love this video, thank you 😍😍

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

    Thank You So much

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

    Thanks for the tutorial

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

    Mano se vc soubesse quantas pessoas vc ajuda e como seus vídeos ajudam no nosso desenvolvimento. Muito obrigado mano, vc é demais. Queria até fazer um pedido, um vídeo criando um site com Next.Js

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

    Great tutorial, only suggestion i would like to make: duplicate the hover border-left in the non hover state, with same background color as your background, so u don't get that jittery text on hover, plus i like to add "use-select: none", so you never get that ugly text highlight.

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

    I'd create an "active" and "inactive" style and just change with a template string and short circuiting. So whenever you click the button it changes the style, without referring directly to 0% or 100%. It gives more control when you're trying to style it on a CSS. But thats just me, I've learned your way and its nice although I feel like I can get lost on my own code. Maybe its my coding ocd.

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

    Great video Brian, it will be nice if after selecting a child component (Link) the sidebar should disapare to the left, it will make the navigation better. Thanks anyway.

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

    Thanks Brian for this awesome video. Any tricks if I want to keep the sidebar always Open and Show the content in the Right pane. What changes it would need in that case? Really appreciate your help.

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

    Hi, Brian! Can you please have a video on uploading image files & storing textual data on firebase with Reactjs? It’ll be really helpful. Thanks! :)

  • @1000nuha
    @1000nuha 2 года назад

    Thank you so much for this great tutorial it's amazing and helpful.
    I have question please, how can I add nasted navbar menu? I just try to add it but it gets tricky when I want to add the mapping.
    If you can help me with this please.

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

    thanks so much for this vid! it helped a ton!! i was wondering though, how can we get a submenus submenu to display? I noticed some other comments were asking a similar question but I didnt see a response.

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

    Greetings, thank you very much for the content.
    A question:
    I have a top navigation bar and this side navigation bar overlaps, how can I make the side one start just below the top one?

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

    Thanks, bro!

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

    you are amazing bro

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

    Nice tutorial. Really helped me a lot. Thanks. Is there a way to display sub-menus in deeper levels, I mean, an item having sub-menu which itself is a sub-menu. This can go to may be 3-4 levels. You are showing only two levels - main menu and sub-menu. Appreciate your quick reply.
    Benny

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

    Amazing vide0
    Thanks ♥

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

    who disliked this video bruh dude like this guy is awsome awsome awsome quality showes.

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

      they must have been watching this upside down and thought it was the thumbs up button

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

    Amazing video. Quick question, I wanna put some text on the top bar, where should I do it?

  • @user-wr4ze5yv1p
    @user-wr4ze5yv1p 3 года назад

    thanks a lot!, it was very helpful!!, how can i do that the sidebar will not hide the content of the page when we expand the navbar? thanks

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

    Obrigado seu lindo! S2

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

    hey brian thankyou for awesome video, i have question, what if we add multi level menu on sidebar? example overview -> reports -> reports a, b, c

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

    How would you go about adding one more nesting item, into an existing nested item.

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

    i seem to have a bug mapping the subNav, u did make use of a "?" before the map function but now all subnavs become active when one is clicked

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

    Thank you

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

    Hello nice tutorial! keep it up 😎 i think i have a bug im trying to open the dropdown from Reports menu when im in another url (example, the Team's url that not have dropdown) but this make a redirect to Reports url and doesnt open the dropdown, i have to been in this reports url if i want to open the dropdown, any suggestion? thanks

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

    Hi, can you please show an example of multilevel sidebar navigation up to 3 level in react. :)

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

    This was a great tutorial. Enjoyed and really easy to follow. I want the sidebar to be at the same z index as the regular page. so when expanded, it shrinks the main content instead of covering it. Any suggestions?

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

      you would need to set the value of the of the width of the div using react so that it changes the on the fly

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

    Thank you for that great video but I would like to have a collapsable dropdown. Would you mind showing me how to do it please

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

    Cool video.
    @25:55 shouldn't you avoid that in favour of setSidebar((currState) => !currState)?

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

    Brother which color theme do you use for Vscode?

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

    How can we keep submenu open when every-time we load app?
    Thank you so much for the tutorial.

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

    Great tutorial! I have a question which is about how to add a URL(external link) in the object list (the SidebarData.js) and access it in the Submenu component?

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

      Oops. Never mind. It just simply need to change the DropdownLink from (= styled(Link) ``;) to (= styled.a ``;) and add href={item.path} in the component like

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

    Thanks for the video, only one thing, the sidebar is not responsive right?

  • @oluwasegunhaziz
    @oluwasegunhaziz 3 года назад +6

    Well done. can you create a React Dashboard Tutorial using Reactstrap

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

      I can add it to my video list

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

      Definately something I'd like to see!

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

      @@briandesign that'll be great, waiting for that

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

    Very nice

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

    Thanks!

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

    hey bro, amazing tutorial, but how can I make disappear the sidebar when I click on tab of sidebar?? Thx

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

    Could you make a portfolio website please :) btw nice video!

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

    Awesome video +++++++++++++++++ 🙂

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

    Hey Brian!
    Thanks for this video! Extremely helpful. I wanted to ask how to keep showing the selected subnav option even after refreshing the page?
    Say I clicked on reports1 and now I refresh the page. How do I keep the SideMenu and Submenu open with 'Report1' selected?

    • @AtifKhan-cm8qv
      @AtifKhan-cm8qv 2 года назад

      @Robson Silveira can you pls tell me how u did it, with code if possible many thanks!

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

    Great tutorial! Do you know any way to make it so that when you click on the tabs to open the drop down menus it stays on the same page and opens the submenu instead of going to its own page?

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

      Just remove the link from the main menu and turn it into a div

  • @DeepakSharma-vl5xr
    @DeepakSharma-vl5xr 3 года назад +1

    Great video! Btw I tried this and added more elements to it(more than what can be displayed on screen at a time) but now I want a scroll functionality for this sidebar only, how I can do that?

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

      add this in css and it will work
      { overflow : auto;
      }

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

    can you upload some videos about, how to create websites using react + redux, please. You explain perfectly. Your videos are great.
    I love your Videos. All of them are very useful, thank you for all of them. But I have an Idea.
    if you launch the React course all of your subscribers will be so happy.
    Course content:
    1. JSX - (HTML + jS)
    2. Redux; Flux
    3. State; Props
    4. Hooks
    5. The component LifeCycleC (Mounting; Updating; unMounting);
    6. ComponentDidMpunt
    7. React-Router
    8. Link
    9. Route -> URL
    10. brouserRouter
    11. Switch

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

      check out my react website videos, I cover a lot of the things you mentioned

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

    nice job .How Can i make responsive this sidebar?

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

    the video was great thanks a lot but one thing that i wanna say please little more explain when you are typing your code for some person like me who is beginner . :)

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

    Thaks for sharing friend

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

    How would you close one dropdown when the other is open?

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

    Goood video dude.....but normalize stating the dependencies required so we wouldn't have to go back and forth stopping and restarting the server.

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

    Traducir por voz
    128 / 5000
    Resultados de traducción
    To start I love your videos, I would like if you can make one with React Sidebar Navbar Footer and of course responsive. 🙏

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

    how do i change the position of the icon. the icons are above the label

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

    35:47 what's key for?

  • @CarlosDiaz-ed9po
    @CarlosDiaz-ed9po Год назад

    buenas como puedo hacer esa barra con next js ?

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

    Very usefull

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

    Class perfect, but to be honest I didn't like "styled. component" tool it is not readable and I confuse about which one is it.

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

    How can one highlight the selected menu item to know the current page?

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

    How to prevend the menu of closing right after click?

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

    At 36:00, when I created all the sidebarData, sideMenu and all, and refresh the page, My data of sidebarData like Overview, reports and etc doesn't show up. Please help me and tell me where I could be wrong

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

    Hi, How to close other open submenu when clicking to another menu. tnx

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

    How to highlight active menu in same sidebar. I tried with id =active but its not working

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

    if i want submenu in submenu how i can do that ??

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

    Ecommerce pls with backend if possible mate.

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

    Hi Brian...Great tutorial and great learning. One problem I am facing. When the number of menu items is high and doesn't fit in a page, the items don't scroll down. Am I doing something wrong or can you or anyone else help me with a solution please? Many thanks!!!

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

      b.c its position is fixed. try to make it absolute or in real case the content will be longer than the navbar so I think it's not a problem I think so

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

      @@sonynguyen4954 Wrong, add a scrollbox in your css.

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

    hay how can we show only one dropdown menu at a time like if you have open report and now you want to open a message. you click on message and now your report will hide and only messages list will be show

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

    ❤️

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

    Hey is there a way to make it so that the navbar at the top is fixed to the top of the screen so you can't scroll down and it disappear?

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

    Thank good videos. Please scroll sidebar.

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

    i have problem when i open sidebar the page will be hide , what can i do to fix problem?

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

    Please which theme are you using, please everything in detail. Thanks in advance

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

    what is name of his theme ?

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

    Can you make another video where there is a halfway collapsable option? Where you only see icons on the left. Not the text. And the centre page should compress as we open the menu.

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

      did you find any solution for compress the centre page

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

      @@diwakarsoni3229 Not yet

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

    Can you guys tell me what extension be used for color of tagged literature 18:00

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

      check my video of my vs code extensions

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

      @@briandesign I cant found it, code in tagged literature have green color like a string, it's hard to identify, it will be easy to have same color as CSS file. Help me

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

    Is there a way to have it expand the drop-down without changing the route for the top level item? IE: You want to go to Report2, but you first navigated to Report then to Report2 when selected.

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

      you can remove the link from Report and just turn it into a div, so it's basically just an open and close button, then all your routes would just be the sub menus

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

      @@briandesign Fantastic, worked perfectly. Also, that was the fastest response on video comment I have ever seen.

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

      @@Johnne1625 glad it worked! and thanks haha, I usually check for comments every few hours

    • @AtifKhan-cm8qv
      @AtifKhan-cm8qv 2 года назад +1

      @@briandesign thank you so much it worked, the only problem is the other menus that doesnt have submenus doesnt have link anymore pls help 🙏 also i tried to add some transition and smoothness on the dropdown but doesnt seem to be getting anywhere!

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

      @@AtifKhan-cm8qv I'm having a similar issue, looks like the explanation is not clear enough from the video and comments.