DEV Community

vuleolabs
vuleolabs

Posted on

# How to Build a Responsive Navbar in Next.js (Step-by-Step)

Every modern SaaS landing page needs a clean responsive navbar.

In this tutorial I'll show how to build one using Next.js and Tailwind CSS.


Navbar Structure

Example component:

export default function Navbar() {
 return (
  <nav className="flex justify-between items-center py-4">
   <div className="font-bold">AI SaaS</div>

   <div className="hidden md:flex gap-6">
    <a href="#features">Features</a>
    <a href="#pricing">Pricing</a>
    <a href="#faq">FAQ</a>
   </div>

   <button className="px-4 py-2 bg-purple-600 rounded-lg">
    Get Started
   </button>
  </nav>
 )
}
Enter fullscreen mode Exit fullscreen mode

Mobile Menu

You can easily add mobile navigation using Tailwind utilities.

md:hidden
Enter fullscreen mode Exit fullscreen mode

Demo

See it in action:

https://vuleo-ai-saas.vercel.app


Full Source Code

If you'd like the full landing page template including this navbar, you can get it here:

https://vuleolabs.gumroad.com/l/nharb

Top comments (1)

Collapse
 
vuleolabs profile image
vuleolabs

I'm curious what stack people use for SaaS landing pages.

Next.js?
Astro?
Plain React?