How to Create a Sidebar in Next.js & Tailwind CSS

Поделиться
HTML-код
  • Опубликовано: 9 май 2022
  • In this tutorial, I will be demonstrating how to create a sidebar menu in Next.js and Tailwind CSS for a simple dashboard such as a blog's admin dashboard.
    Link to tailwind documentation on how to configure tailwind CSS with Next.js tailwindcss.com/docs/guides/n...
    Benefits of using Tailwind CSS
    1. It is Highly Customizable: Tailwind CSS is a highly customizable framework. The configuration file enables easy customization of color palettes, styling, spacing, themes, etc.
    2. It Has Common Utility Patterns: Eliminate the hassle of naming classes with Tailwind CSS. The availability of common utility patterns solves numerous problems like specifying classes, organizing them, cascading them, and much more. Utility classes simplify the process of creating custom components. You do not need to hard-code with Tailwind CSS. You can apply the theme() function to extract values from the configuration files.
    3. It Can Be Optimized Using PurgeCSS: A major advantage of Tailwind CSS is that optimization can be performed using PurgeCSS. PurgeCSS can reduce the file size considerably by scanning the HTML and removing unused classes. It is easy to set up PurgeCSS in combination with Tailwind CSS and is highly recommended to do so before deploying the site. As the size of the project grows, the size of the CSS file also increases. However, this does not happen when using Tailwind. The use of a standardized set of classes keeps the file size small as long as the project remains active.
    4. It Enables Building Complex Responsive Layouts Freely: The Tailwind CSS framework uses a default mobile-first approach.
    5. It Facilitates Fluid Community Interaction
    Source code: github.com/dieudonneAwa/blog-...
    Check OUT other React tutorials:
    ▶️ • React Tutorials
    _______________________________________
    SOURCE CODE:
    github.com/dieudonneAwa/blog-...
    ___________________________________________
    🙏 PLEASE SUBSCRIBE FOR MORE VIDEOS 👇
    bit.ly/3cIb4er
    ____________________________________________
    🔮OTHER VIDEOS YOU MIGHT LIKE👇👇
    ▶️ How to create React App from Scratch: • How to setup React app...
    ▶️Create Sequelize Migration and Association: • Create Sequelize Migra...
    ▶️How to create an animated modal in reactjs: • How to create a nicely...
    ▶️ How to render a list of todo objects in Reactjs: • Render a list of task ...
    ▶️How to setup sequelize and postgres: • How to setup Sequelize...
    ▶️Password Reset using SendGrid: • Password Reset using S...
    ▶️ CRUD Operations with sequelize: • CRUD operations with S...
    ____________________________________________
    HELPFUL RESOURCES
    Certified ScrumMaster Training: Get $200 off Today! Use this code SCRUM200
    click.linksynergy.com/fs-bin/...
    $2,760 in Savings: Premium PMP Exam Prep Boot Camp! Get everything you need to pass & enhance your skills
    click.linksynergy.com/fs-bin/...
    Follow me on Social Media:
    Facebook: profile.php?...
    Twitter: awadieudone?s=09
    GitHub: github.com/dieudonneAwa
    Personal Blog: awadieudonne.com/
    KEYWORDS
    Create a sidebar in Next.js, Next.js sidebar, Tailwind CSS sidebar, Next.js and Tailwind CSS, Sidebar layout in Next.js, Next.js and Tailwind CSS tutorial, Adding a sidebar in Next.js, Styling sidebar with Tailwind CSS, Next.js sidebar tutorial, Next.js and Tailwind CSS sidebar, Next.js and Tailwind CSS navigation, Next.js sidebar navigation, Tailwind CSS and Next.js sidebar, Creating sidebar in Next.js and Tailwind CSS, Next.js and Tailwind CSS: A complete guide to create a sidebar, How to implement sidebar in Next.js using Tailwind CSS, Next.js and Tailwind CSS for sidebar, Next.js Tailwind CSS sidebar, Next.js and Tailwind CSS: A step by step guide to create a sidebar.
  • НаукаНаука

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

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

    This is really good dude; one question, if the content section have long which needs vertical scrolling will the sidebar stay fixed?

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

    thank you for the education

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

    Hi, thank you, this has clarified a few things for me. My only concern with your navbar is that you are duplicating it. With a simple trick, I was able to toggle the nav function to modify CSS using just one menu - this is much easier to maintain (unless one would want different items displayed in each).

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

    Just what I needed thanks a ton.

  • @Kunal-jp8tn
    @Kunal-jp8tn Год назад +1

    Great tutorial man

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

    Very nice design, on thing i doubt that when i change the route manually will the active tab change, if not how can I do so

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

    When im console.log(activeMenu) i got notice like this undefined, how to fix this?

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

    How do you add a dropdown to the side bar?

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

    Does this page work on server side rendering

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

    Hi, kindly help me on adding submenu on your code, thanks

  • @PixelGM
    @PixelGM 13 дней назад +1

    13:25 Sidebar Tailwind CSS Properties

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

    ["bg-light-lighter"]: activeMenu.id === menu.id, , how to fix this?

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

    nice

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

    This is helpful, how about a full layout, responsive like this but with a header and a footer.

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

      Thanks for watching Juliet. Please remember to subscribe. I will be uploading more helpful videos in the coming weeks.

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

    Error: Failed prop type: The prop `href` expects a `string` or `object` in ``, but got `undefined` instead.
    Open your browser's console to view the Component stack trace.
    Can i get some help please?

    • @joshuajaydan
      @joshuajaydan 10 месяцев назад +1

      Did you import Link from next?

  • @christianenriquevillamoral6140

    How do I make the sidebar static and not affect the content, thanks for the video, I hope a prompt response

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

    Great video. Constructive criticism: the audio quality is so poor it makes watching the video unpleasant.

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

    Server Error
    TypeError: Cannot read properties of undefined (reading 'id') - ["bg-light-lighter"]: activeMenu.id === menu.id, help

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

    Nice tutorial, thank you. I wanted to point out a problem: the logout menu item is not part of activeMenu. If you add a Link to the logout menu item, it will trigger the useMenu, which will fail because the logout router path is not in activeMenu. You cannot add logout to activeMenu unless you add special treatment for the positioning at the bottom of the page. A hack to work around this is to create a memoItems list which includes logout in the array and pass that to useMemo. What is a better way to deal with this?

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

      Logout is supposed to log you out of that dashboard, meaning you should be taken out of the dashboard to a different page for instance, the login page

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

    TypeError: Cannot read properties of undefined (reading 'id') how to fix this?

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

      make sure your menu array is initialized before the menuIcons function. For me, my issue was that I did "const router = useRouter" instead of "const router = useRouter();"

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

    help me please

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

    I just can't get that shit to not cover content. CSS sucks so bad I just can't