Creating a Navigation Bar with Next.js & Tailwind CSS: A Step-by-Step Guide
HTML-код
- Опубликовано: 7 июн 2024
- Private 1 on 1 Help 👇
calendly.com/dabrettwestwood/...
Join my FREE Discord to talk and network about web development! 👇
/ discord
In this tutorial, we'll be showing you how to create a sleek and functional navigation bar using the popular JavaScript framework Next.js and the utility-first CSS library Tailwind CSS. Whether you're a beginner or an experienced web developer, this guide will provide you with all the information you need to get started with building a navigation bar for your next project.
We'll be covering everything from setting up your Next.js environment to integrating Tailwind CSS and styling your navigation bar. You'll also learn how to add links, active states, and dropdown menus to your navigation bar. By the end of this tutorial, you'll have a solid understanding of how to create a navigation bar with Next.js and Tailwind CSS.
Some key topics that will be covered include:
Setting up a Next.js project
Installing Tailwind CSS
Integrating Tailwind CSS with Next.js
Creating a navigation bar using HTML and Tailwind CSS classes
Adding links to the navigation bar
Adding active states to navigation links
Customizing the navigation bar with Tailwind CSS utilities
Don't miss out on this comprehensive guide to creating a navigation bar with Next.js and Tailwind CSS. Make sure to like, comment, and subscribe for more tutorials like this!
TimeStamps
0:00 Intro
0:05 Create NextJS Project
1:52 Install TailwindCSS in project
5:05 Create Navbar Component
6:30 Create & Customize Navbar
30:00 Outro - Развлечения
Great video and solid tutorial. Keep the content coming! Always hard putting yourself out there.
Thanks! I really appreciate it!
Man, you are so chill. Thats great, I mean, its not rocket science, no need verbosity. Thanks for the video, for sure Im going to keep up following your content. Would love to watch you teaching some supabase and prisma stuff!
Thank you so much!
I really enjoyed this! good work- keep them coming
Thank you! Will do!
Thank you for the great tutorial, Brett!
One refactoring suggestion on 22:28
```
```
great tutorial. tailwind is pretty new to me. thx a lot.
No problem, glad I can help!
Thank you for explaining every part
You are welcome!
Great video! Pro + simple = really pro!
Thank you so much for tuning in!
This has helped me a lot. Thankyou!! 👍
You are welcome!
Done and done, thanks for the video.
No problem!
thank you for this tutorial bro, you helped me understand many things i could not get before even though my first language is not even English, you explain really good!!!
No problem! Glad I was able to help you out!
Great video, excelent explication.
Glad it was helpful!
Thank you so much.
You are welcome!
I like this!
Thanks
As I've picked up in another tutorial when updating state it is best practice to use the prevState argument when updating the state, e.g. setMenuOpen((prevState) => !prevState)
Solid tut && subbed for more content. Watching you grow your channel.
Thank you and yea the code you provided is best practice
great tutorial keep up
Thanks!
Great tutorial, thanks man. Would be perfect if it'd have a submenu example.
Thank you!
hey this was fun to do just kindly increase the font size in vs code and maybe provide the source code to avoid constant pausing/fowarding/rewinding on the video
good work bro!
Thanks!
Nice Explanation
Thank you!
Great ❣️
Thanks 🤗
Good tutorial ser
Thank you!
thank goodness I found this video. 😅
I'm glad!
I really hope you are getting good retribution for this amazing job. Thanks a lot. Just have a really quick question. Did you use the next/font? I see that you imported it but I don't get where it is used or how.
Thank you!
next/font is auto imported and it's used in the layout.js file. you will import the font style from next/font/google. Then you will use it in your body
this same will work when i do with typescript as set to be yes know??
sir how to add multiple level dropdown in the nav bar
Great tutorial; would there be any alternative possible for useState-array (avoiding 'use client' statements in front of import)? Apparently any component is considered to be [solely] a server-side component when residing in the /app directory (as of Next.js 13)? Thanks in anticipation
I don't think there is an alternative at the moment. It must be set as a client side rendered page since it has interactivity. You might be able to separate components and try that way
@@brettwestwooddeveloper thanks Brett! Keep up the good work!
@@brettwestwooddeveloper you can split all the individual components into separate jsx files only adding 'use client' in the file that imports useState and then assemble it all into the navbar file, the same way components are assembled the layout file.
i didnt understood how your mobile nav menu animates from left to right when you click on hamburger (menu icon)
How did you align logo with links in horizontal lane?
I had a div inside the main div that had the properties. h-full and item-scenter. That would align it horizontal. Let me know if that makes sense. I did it at the 9:25 mark
Hello Brett
maybe one of these should be marked as a client entry with "use client"
I am getting this error when i an running my code….!!!
Would you help me out with this one
I will really appreciate it….!!!
any pages using interactivity such as useState should have the use client directive
Well done! But there is a request. Increase the font of your code!!! Because you can't see anything! And make the video itself a little lighter, otherwise it's dark.
Thank you! Good luck!
ps - Don't drop your channel.
Thanks for the feedback, I was wondering about that! Will do next time
@@brettwestwooddeveloper You are doing the right thing that you are talking about ready-made code, and not writing it online. Your story does not tire, but rather gives energy for independent work on the project.
Wish you have a million subscribers! - and even more!
Can you please provide the code?
don't have this source code anymore.
github Repo bro ?
My friend i can't see the code 😤
Can I get the source code please
I really need it please help your subscriber 😅