Build a Responsive Side Navbar w/ Submenu using Next.js 13 and Tailwind CSS

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

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

  • @nikabilanych3419
    @nikabilanych3419 Год назад +7

    I really like that youve put the constants into a separated file. I sometimes struggle with figuring out what props will the component be carrying and where it would be "tidier" to define them. (A nextjs newbie here)
    Thank you!

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

      and like i even found it helpful to "visualise" what routes we will eventually need by putting them all out like that first. Great job, for real🥹

    • @frankiefreemann
      @frankiefreemann 6 месяцев назад

      Same. NextJs newbie, wished I started writing with NextJs last year.

  • @ioanniskaltsos8612
    @ioanniskaltsos8612 6 месяцев назад +1

    Very beautiful! Simple, robust, flexible without much and able to be extended. Touching perfection. Well done!!!

  • @happymalyo_
    @happymalyo_ 11 месяцев назад +4

    This tutorial is truly exceptional! I've learned so much. The content is well organized and follows best practices. Please, keep creating such fantastic videos

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

    I took me soo much scrolling even after searching with exact title. Great tutorial.

  • @endlessia
    @endlessia Год назад +3

    Your content is so underrated ! I learned a lot through your videos ! :)

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

    You are a great teacher. Love from Karachi Pakistan.

  • @sebastianvh-r1r
    @sebastianvh-r1r 4 дня назад

    gracias, lo veo en spanish, y aun así se entiende, es excelente !! saludos desde uruguay!!

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

    I think you explained things well enough for people who are familiar with the hooks and tech stack you're using. I didn't have a problem at all. The title is "Build a Responsive Side Navbar w/ Submenu using Next.js 13 and Tailwind CSS" not "Let me hold your hand while we do something with 3+ layers of abstraction"
    Haters gonna hate, haha. Amazing job Hosna!

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

    Wonderful Sidebar and Animations, wow!

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

    This was very helpful, thank you for posting this.

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

    This is something I've been looking for . Thank you 👍

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

    You are so gifted thank you so much!

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

    Excelent content. TY very much for share it with us.

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

    Very nice!! Excellent job!!

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

    Very good job

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

    im having a issue, it seems the screen is not recognising the side bar when going reponsive

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

    You answer my question mom 😁 thanks

    • @hqasmei
      @hqasmei  9 месяцев назад

      Happy to help!

  • @gamers4life1
    @gamers4life1 17 дней назад

    I wish you could explain further for some of the things you do but thanks!

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

    Thanks for repo

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

    Hey, thanks for a great video. What if I want a slightly wider side nav? Can't get the wrappers to play ball. using w75 instead of w60. Even Cursor is at a loss.

  • @NiharGandhi
    @NiharGandhi 6 месяцев назад

    Amazing video. Helped me a lot. I just want to know if there's a posibloty to add a sign out button?

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

    HOW DID THE HEADER NOT being stick at the top and not scrolling as well? what did you do?

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

    THANK YOU!

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

    Hello, can this be achieved in react and react-router-dom?

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

    Help me so much, but i thinks it's better to show the whole code after copy pasting. Thanks so much

  • @frankiefreemann
    @frankiefreemann 6 месяцев назад

    Honey, you just gained a subscriber. Thanks for all you do.
    A quick one, I noticed that this side nav does not have a logout option. What If I want to have a logout option? And the side nav is for users mostly or maybe an admin. Any thoughts?

  • @unkownsiner
    @unkownsiner 11 месяцев назад

    Great video I followed your amazing tutorial. Thought I'd challenge myself and add some more items in the dashboard page but I've ran into an issue with responsiveness. The table I placed in my Dashbaord page does not want to resize based on the "device" or me shrinking the browser screen. Has anyone else ran into this issue?

  • @lambo-ca
    @lambo-ca Год назад +1

    Finally... thanks.

  • @andreascabreira
    @andreascabreira 11 месяцев назад

    thank you so much!

  • @destroyer-medic5073
    @destroyer-medic5073 Год назад

    Awesome tutorial! I really like the straightforwardness in your tutorials. Though may I ask is there a way to disable the sidebar in a specific page such as /login?

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

      Yes, great question! So you are going to want to have a different layout that the one I had. Right now I am using the root layout isn't setup to not have the sidebar. You can checkout this repo, better example github.com/hqasmei/site-muse
      Let me know if you have any other questions!

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

      One interesting thought I would have here would to use, usePathname which is a client component hook allowing you to check if (!isLoginURL) return ( );
      return ( );
      Or whatever you want to render when there
      This is a really hacky way though since the server cannot read URL in Nextjs you would have a layout shift since it’ll render either your fallback because usePathname can return null or the return statement that with until the component mounts on the client and can read the URL.
      Another hacky way would be to set a cookie using server actions, which are stable as of Next14, specifically for the /login route. So essentially you could on your app load set a cookie { name: “loginRoute” value: “false”, path:”/login” } then prop drill the reading of this cookie and then your client component would know if it needs to render that sidebar based on the value of that cookie.
      See nextjs.org/docs/app/api-reference/functions/cookies and nextjs.org/docs/app/api-reference/functions/server-actions.
      I do still agree with having a different layout, just interesting ways you could solve your problem. They are hacky but it’s just a cool thought process on the different solutions.

  • @broken_jail2506
    @broken_jail2506 7 месяцев назад +1

    Really nice, would be better if the side bar is retractable.

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

      You read my mind, made another video here that is retractable ruclips.net/video/0QPXqRifh-c/видео.html

  • @johnpaul5836
    @johnpaul5836 9 месяцев назад

    This was going so well. But when you open and close the mobile menu a few times you get error errors.mjs:19 Uncaught Error: Only two keyframes currently supported with spring and inertia animations. It doesn't seem to like const sidebar having two 'spring' transiton types. So I set the first type to 'tween' which is the default and all work fine now.

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

      Looks like someone else got a similar issue, let me look into it. Not sure if any of the packages changed.

    • @johnpaul5836
      @johnpaul5836 9 месяцев назад

      @@hqasmei Hi, I did use the most up to date versions of all packages. I also noticed that NPM run dev, the first time the page loads, I see no chevrons in the sidebar and the mobile menu toggle wont work. I have to refresh to get everything going. Running Build does get everything working on first load though.

    • @johnpaul5836
      @johnpaul5836 9 месяцев назад

      I think the reason the chevrons dont appear on the first page load is there must be a delay in getting the info from the usePathname() hook. I manage to get round this by setting useState to when we have a path. so under the MenuItem compoenent, we can say
      const pathname = usePathname();
      const isCurrentPath = item.path === pathname;
      const [subMenuOpen, setSubMenuOpen] = useState(isCurrentPath);

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

    It was a really helpful tutorial. I have kind of a silly question . Where are all the components and files being rendered cauz I wasn't able to locate an index.tsx file during the entire tutorial

    • @Dom-zy1qy
      @Dom-zy1qy 8 месяцев назад

      Nextjs app router uses layout.tsx

  • @shanKirs10
    @shanKirs10 11 месяцев назад

    Anyone - any ideas on how it can be ported to React?
    Thanks.

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

    Great video, thank you. Curious, what VS code theme are you using?

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

      Thanks Donald, I'm just using the default theme.

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

      @@hqasmei thank you, keep up the great work!!

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

    I know it sound stupid, but how can I change the menuhamburger color?

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

      No, not a stupid question Lucas. If you go inside header-mobile.tsx file and find the Path component, change "stroke" to whatever hex color you like, like stroke="#22c55e"

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

      It's not stupid, it is a very valid question. Happy coding!

  • @DelightBessie
    @DelightBessie 9 месяцев назад

    can you please do this with next js 14

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

    Merc Hosna!

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

    Super

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

    Hello sister I want to learn nextjs . Your video is good .

  • @harrishpaul7374
    @harrishpaul7374 11 месяцев назад

    I need drawer in this sidenav bar

  • @williamsernesto1
    @williamsernesto1 9 месяцев назад

    I was not able to use "SPRING" type animation it keeps crashing saying '' Error: Only two keyframes currently supported with spring and inertia animations. '' so I switch it for tween type it does not look as good as yours haha... here is the code if anyone has the same problem const sidebar = {
    open: {
    width: '100%',
    transition: {
    type: 'tween',
    duration: 0.3, // Adjust duration as needed
    },
    },
    closed: {
    width: 0,
    transition: {
    type: 'tween',
    duration: 0.3, // Adjust duration as needed
    },
    },
    };

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

      Looks like someone else got a similar issue, looking it to it will get back to you.

  • @mohammedkaka5558
    @mohammedkaka5558 9 месяцев назад

    💗💗

  • @TikTokTrendsCompilation
    @TikTokTrendsCompilation 11 месяцев назад

    this is a very bad example. cool animation though. if i have a lot of menu items then i'm unable to scroll through the navigation on mobile. same thing for desktop

    • @hqasmei
      @hqasmei  11 месяцев назад

      Appreciate the feedback! Good point if there are many menu items. Will think about how it should function for that use case. If you got any suggestions?

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

      ​@@hqasmeiThis have a fix? Another cool thing I think its to add the animation of the mobile links (open close) to the dropdown menu of the desktop sidebar

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

    go to kitchen for cooke mahshy (this it egyption food)

  • @Gaamaa-oz5ef2lf3n
    @Gaamaa-oz5ef2lf3n 9 месяцев назад

    Too complecated.
    Ha ha !
    That's what React.js making any simple things complecated ?
    Hello !
    Is there any one who teach things simple and easy on RUclips ?

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

    is this a "watch me build" kinda vid or a tutorial. everything was poorly explained

  • @TikTokTrendsCompilation
    @TikTokTrendsCompilation 11 месяцев назад +2

    if you're just gonna copy and paste literally EVERYTHING, then don't make a video about it at all.

    • @hqasmei
      @hqasmei  11 месяцев назад

      Appreciate the feedback!